security.conf 2.3 KB

1234567891011121314151617181920212223242526272829303132
  1. # config to don't allow the browser to render the page inside an frame or iframe
  2. # and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
  3. # if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
  4. # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
  5. add_header X-Frame-Options "SAMEORIGIN";
  6. #Handled by CDN admin
  7. # when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
  8. # to disable content-type sniffing on some browsers.
  9. # https://www.owasp.org/index.php/List_of_useful_HTTP_headers
  10. # currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
  11. # http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx
  12. # 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020
  13. add_header X-Content-Type-Options "nosniff";
  14. # This header enables the Cross-site scripting (XSS) filter built into most recent web browsers.
  15. # It's usually enabled by default anyway, so the role of this header is to re-enable the filter for
  16. # this particular website if it was disabled by the user.
  17. # https://www.owasp.org/index.php/List_of_useful_HTTP_headers
  18. add_header X-XSS-Protection "1; mode=block";
  19. add_header Referrer-Policy "no-referrer-when-downgrade";
  20. # with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy),
  21. # you can tell the browser that it can only download content from the domains you explicitly allow
  22. # http://www.html5rocks.com/en/tutorials/security/content-security-policy/
  23. # https://www.owasp.org/index.php/Content_Security_Policy
  24. # I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval'
  25. # directives for css and js(if you have inline css or js, you will need to keep it too).
  26. # more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful
  27. # add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'";
  28. #For Clouflare users comment this out as it's handle from the admin UI
  29. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
  30. # Prevent search engine indexing
  31. add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";