Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB

8 years ago
  1. server {
  2. listen 443 ssl http2;
  3. listen [::]:443 ssl http2;
  4. {% if proxy_protocol %}
  5. # Alternate Port for PROXY PROTOCOL incoming connections
  6. listen 10443 ssl http2 proxy_protocol;
  7. listen [::]:10443 ssl http2 proxy_protocol;
  8. # RealIP rewrite authorized for connection from reverse-proxy
  9. set_real_ip_from {{ hostvars | ip_from_inventory('vm_gateway') }};
  10. real_ip_header proxy_protocol;
  11. {% endif %}
  12. # Do not advertise nginx version number
  13. server_tokens off;
  14. # Certificates location from CertBot
  15. ssl_certificate /etc/letsencrypt/live/{{ server_fqdn }}/fullchain.pem;
  16. ssl_certificate_key /etc/letsencrypt/live/{{ server_fqdn }}/privkey.pem;
  17. # TLS Mozilla Guideline v5.4,
  18. # nginx 1.14.2, OpenSSL 1.1.1d, modern configuration
  19. ssl_session_timeout 1d;
  20. ssl_session_cache shared:MozSSL:10m;
  21. ssl_session_tickets off;
  22. # modern configuration
  23. ssl_protocols TLSv1.3;
  24. ssl_prefer_server_ciphers off;
  25. # HSTS (2 years, no preloading)
  26. add_header Strict-Transport-Security "max-age=63072000" always;
  27. # OCSP stapling
  28. ssl_stapling on;
  29. ssl_stapling_verify on;
  30. # verify chain of trust of OCSP response using Root CA and Intermediate certs
  31. ssl_trusted_certificate /etc/letsencrypt/live/{{ server_fqdn }}/chain.pem;
  32. # Include custom locations
  33. include /etc/nginx/locations/{{ server_fqdn }}/*.conf;
  34. }