Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Security Policy should be configurable per virtual host #222

Closed
basilabbas opened this issue Mar 14, 2019 · 1 comment
Closed

Content Security Policy should be configurable per virtual host #222

basilabbas opened this issue Mar 14, 2019 · 1 comment
Labels
wontfix This will not be worked on

Comments

@basilabbas
Copy link

The top-level file nginx.conf defines lines for the Content-Security-Policy:

  # Add Content-Security-Policy for HTML documents.
  # h5bp/security/content-security-policy.conf
  map $sent_http_content_type $content_security_policy {
    ~*text/html "script-src 'self'; object-src 'self'";
  }

This is not practical since the $content_security_policy is different for each virtualhost domain and should be set at the virtual host file level instead of the top level nginx.conf.

@LeoColomb
Copy link
Member

Thanks for opening this, @basilabbas!

This is not practical since

Indeed. Actually I'm thinking of removing default activation.

should be set at the virtual host

Maps can't be set in a server{}, only in http{}.
Anyway, that is up to the user to edit the main file to match the wanted config.

@LeoColomb LeoColomb added the wontfix This will not be worked on label Mar 14, 2019
@LeoColomb LeoColomb changed the title Content Security Policy should be configurable per virtual host instead of having it in the top level nginx.conf file Content Security Policy should be configurable per virtual host Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants