ansible/roles/nginx-reverse-proxy/templates/nginx/snippets/proxy-common-ssl.conf.j2

33 lines
1 KiB
Text
Raw Normal View History

2019-03-14 10:53:44 +01:00
# {{ ansible_managed }}
# Listen for IPv4 and IPv6 with HTTP2
listen [::]:443 ssl http2;
listen 443 ssl http2;
# Hide NGINX version
server_tokens off;
# Reverse Proxy Adm
set_real_ip_from 10.128.0.0/16;
real_ip_header P-Real-Ip;
2019-03-14 12:25:27 +01:00
# SSL based on https://mozilla.github.io/server-side-tls/ssl-config-generator/
2019-03-14 10:53:44 +01:00
ssl on;
2019-03-14 12:25:27 +01:00
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_protocols TLSv1.2;
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";
2019-03-14 11:53:55 +01:00
ssl_prefer_server_ciphers on;
2019-03-14 12:25:27 +01:00
add_header Strict-Transport-Security max-age=15768000;
# OCSP Stapling,
ssl_stapling on;
ssl_stapling_verify on;
2019-03-14 10:53:44 +01:00
2019-03-14 11:53:55 +01:00
# Use more secure ECDH curve
ssl_ecdh_curve secp521r1:secp384r1;
2019-03-14 10:53:44 +01:00
# Executer "cd /etc/ssl/certs; openssl dhparam -out dhparam.pem 4096" avant d'activer
ssl_dhparam /etc/ssl/certs/dhparam.pem;