How to set up CSP in nginx reverse proxy
-
Today I installed the latest ver. WordPress.
I am using apache2 web server behind nginx reverse proxy server.
I mainly set HTTP to nginx servers. Content-Security-Policy is set in nginx like thisadd_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';" always;
Everything seems to be working fine, but I get this warning on securityheaders.com
Content-Security-PolicyThis policy contains ‘unsafe-inline’ which is dangerous in the default-src directive. This policy contains ‘unsafe-eval’ which is dangerous in the default-src directive.
If I set Content-Security-Policy to
add_header Content-Security-Policy "default-src 'self';" always;
I get an A+ on securityheaders.com, but the whole wordpress is destroyed (probably css).
I know it’s an nginx issue, but no one ever answers on the local nginx forum.
The page I need help with: [log in to see the link]
- The topic ‘How to set up CSP in nginx reverse proxy’ is closed to new replies.