File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,22 @@ http {
3232
3333 keepalive_timeout 65 ;
3434
35+ # security, reveal less information about ourselves
3536 server_tokens off; # disables emitting nginx version in error messages and in the “Server” response header field
3637 more_clear_headers 'Server' ;
38+ more_clear_headers 'X-Powered-By' ;
3739
40+ # prevent clickjacking attacks
41+ more_set_headers 'X-Frame-Options: SAMEORIGIN' ;
42+
43+ # help to prevent cross-site scripting exploits
44+ more_set_headers 'X-XSS-Protection: 1; mode=block' ;
45+
46+ # help to prevent Cross-Site Scripting (XSS) and data injection attacks
47+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
48+ more_set_headers "Content-Security-Policy: object-src 'none'; frame-ancestors 'self'; form-action 'self'; block-all-mixed-content; sandbox allow-forms allow-same-origin allow-scripts allow-popups allow-downloads; base-uri 'self';" ;
49+
50+ # enable response compression
3851 gzip on;
3952 brotli on;
4053 brotli_static on;
You can’t perform that action at this time.
0 commit comments