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.

46 lines
1.8 KiB

  1. server {
  2. listen 443 ssl http2;
  3. listen [::]:443 ssl http2;
  4. {% if nginx_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. server_name {{ nginx_site_fqdn }} {{ nginx_site_alternate_fqdns | join(' ') }};
  13. # Do not advertise nginx version number
  14. server_tokens off;
  15. # Certificates location from CertBot
  16. ssl_certificate /etc/letsencrypt/live/{{ nginx_site_fqdn }}/fullchain.pem;
  17. ssl_certificate_key /etc/letsencrypt/live/{{ nginx_site_fqdn }}/privkey.pem;
  18. # TLS Mozilla Guideline v5.4,
  19. # nginx 1.14.2, OpenSSL 1.1.1d, modern configuration
  20. ssl_session_timeout 1d;
  21. ssl_session_cache shared:MozSSL:10m;
  22. ssl_session_tickets off;
  23. # modern configuration
  24. ssl_protocols TLSv1.3 {{ 'TLSv1.2' if nginx_tls_1_2 }};
  25. {% if nginx_tls_1_2 %}
  26. 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;
  27. {% endif %}
  28. ssl_prefer_server_ciphers off;
  29. # HSTS (2 years, no preloading)
  30. add_header Strict-Transport-Security "max-age=63072000" always;
  31. # OCSP stapling
  32. ssl_stapling on;
  33. ssl_stapling_verify on;
  34. # verify chain of trust of OCSP response using Root CA and Intermediate certs
  35. ssl_trusted_certificate /etc/letsencrypt/live/{{ nginx_site_fqdn }}/chain.pem;
  36. # Include custom locations
  37. include /etc/nginx/locations/{{ nginx_site_fqdn }}/*.conf;
  38. }