Advertisement
Nodiaque

ssl.conf

Jun 10th, 2023
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. ## Version 2022/08/20 - Changelog: https://github.com/linuxserver/docker-baseimage-alpine-nginx/commits/master/root/defaults/nginx/ssl.conf.sample
  2.  
  3. ### Mozilla Recommendations
  4. # generated 2022-08-05, Mozilla Guideline v5.6, nginx 1.17.7, OpenSSL 1.1.1k, intermediate configuration
  5. # https://ssl-config.mozilla.org/#server=nginx&version=1.17.7&config=intermediate&openssl=1.1.1k&guideline=5.6
  6. add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
  7.  
  8. ssl_certificate #####;
  9. ssl_certificate_key ####y;
  10. ssl_session_timeout 1d;
  11. ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
  12. ssl_session_tickets off;
  13.  
  14. # curl https://ssl-config.mozilla.org/ffdhe2048.txt > /path/to/dhparam
  15. ssl_dhparam /config/nginx/dhparams.pem;
  16.  
  17. # intermediate configuration
  18. ssl_protocols TLSv1.2 TLSv1.3;
  19. ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
  20. ssl_prefer_server_ciphers off;
  21.  
  22. # HSTS (ngx_http_headers_module is required) (63072000 seconds)
  23. add_header Strict-Transport-Security "max-age=63072000;includeSubDomains; preload" always;
  24.  
  25. # OCSP stapling
  26. ssl_stapling off;
  27. ssl_stapling_verify on;
  28.  
  29. # verify chain of trust of OCSP response using Root CA and Intermediate certs
  30. ssl_trusted_certificate ####;
  31.  
  32. # Optional additional headers
  33. add_header Cache-Control "no-transform" always;
  34. add_header Content-Security-Policy "upgrade-insecure-requests; frame-ancestors 'self'";
  35. add_header Permissions-Policy "interest-cohort=()";
  36. add_header Referrer-Policy "same-origin" always;
  37. add_header X-Content-Type-Options "nosniff" always;
  38. add_header X-Frame-Options "SAMEORIGIN" always;
  39. #add_header X-UA-Compatible "IE=Edge" always;
  40. add_header X-XSS-Protection "1; mode=block" always;
  41.  
  42.  
  43. if ($geo-blacklist = no) { return 404; }
  44. if ($lan-ip = yes) { set $geo-whitelist yes; }
  45. if ($geo-whitelist = no) { return 404; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement