nginx.ssl.conf 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #### Security Headers
  2. ## [WARNING] Strict-Transport-Security will stop HTTP access for specified time.
  3. add_header Strict-Transport-Security "max-age=63072000";
  4. ## [WARNING] X-Frame-Options DENY will break iframed sites.
  5. add_header X-Frame-Options DENY;
  6. add_header X-Content-Type-Options nosniff;
  7. ## [OPTION] Server Name
  8. ## Commented out, and will be put in each site conf, to allow the rest to work for any subdomain
  9. ssl_certificate /etc/letsencrypt/live/demu.red/fullchain.pem;
  10. ssl_certificate_key /etc/letsencrypt/live/demu.red/privkey.pem;
  11. ssl_trusted_certificate /etc/letsencrypt/live/demu.red/fullchain.pem;
  12. #### SSL Stapling
  13. ## [WARNING] Requires a valid `ssl_trusted_certificate`
  14. ssl_stapling on;
  15. ssl_stapling_verify on;
  16. ## Google DNS, Open DNS, Dyn DNS.
  17. resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 216.146.35.35 216.146.36.36 valid=300s;
  18. resolver_timeout 3s;
  19. #### Session Tickets
  20. ssl_session_tickets on;
  21. ssl_session_timeout 24h;
  22. ## [WARNING] Session Cache must be the same size in all `server` blocks.
  23. ssl_session_cache shared:SSL:100m;
  24. ## [WARNING] Session Ticket Key must have been generated.
  25. ## $(openssl rand 48 > ticket.key)
  26. ssl_session_ticket_key /etc/nginx/ssl/ticket.key;
  27. #### Diffie-Helman Parameters
  28. ## [WARNING] Diffie-Helman Parameters must have been generated.
  29. ## $(openssl dhparam -out dhparam.pem 4096)
  30. ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  31. #### ECDH Curve
  32. ## [OPTION] Select your preferred curve.
  33. ## Option 1. [DEFAULT] Typically sufficient.
  34. ssl_ecdh_curve secp384r1;
  35. ## Option 2. [WARNING] Slower and breaks some IE on mobiles.
  36. ## Slightly better with a larger generation.
  37. #ssl_ecdh_curve secp521r1;
  38. #### Preference & Protocols
  39. ssl_prefer_server_ciphers on;
  40. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  41. #### Cipher List
  42. ## [OPTION] Pick on Cipher List from Below.
  43. ## [WARNING] Breaks some browsers on some settings.
  44. ## Option 1. Super-modern, probably not suitable for production, very secure.
  45. ## Option 2. [DEFAULT] Modern, no XP, secure.
  46. ## Option 3. Intermediate, no IE <= 6, less secure.
  47. ## Cipher List
  48. ## https://cipherli.st
  49. ## Grade A (A+ with HSTS at >= 6 Months)
  50. ## 100 % Security
  51. ## Low Compatibility
  52. ## - No Android 2
  53. ## - No Java
  54. ## - No IE < 11
  55. ## Robust Forward Secrecy
  56. #ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  57. ## [DEFAULT] Mozilla SSL Configuration Generator
  58. ## https://mozilla.github.io/server-side-tls/ssl-config-generator/
  59. ## Nginx for Modern Browsers
  60. ## Grade A (A+ with HSTS at >= 6 Months)
  61. ## 90 % Security
  62. ## Medium Compatibility
  63. ## - No Java 6 (No DH parameters > 1024 bits)
  64. ## - No IE on XP
  65. ## Robust Forward Secrecy
  66. ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
  67. ## Mozilla SSL Configuration Generator
  68. ## https://mozilla.github.io/server-side-tls/ssl-config-generator/
  69. ## Nginx for Intermediate Browsers
  70. ## Grade A-
  71. ## 90 % Security
  72. ## High Compatibility
  73. ## - No Java 6 (No DH parameters > 1024 bits)
  74. ## - No IE 6
  75. ## Some Forward Secrecy
  76. #ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';