2014-09-13 22:16:54 +02:00
|
|
|
{% set domain_name = item.nginx_domain_name %}
|
2014-09-06 20:32:37 +02:00
|
|
|
|
2014-09-13 22:16:54 +02:00
|
|
|
# concatenated key + cert
|
|
|
|
# See: http://nginx.org/en/docs/http/configuring_https_servers.html
|
|
|
|
ssl_certificate {{ tls_key_dir }}/{{ domain_name }}.crt.pem;
|
|
|
|
ssl_certificate_key {{ tls_key_dir }}/{{ domain_name }}.crt.pem;
|
2014-09-06 20:32:37 +02:00
|
|
|
|
2014-12-06 20:19:12 +01:00
|
|
|
ssl_session_timeout 24h; # 24 hour timeout
|
2014-12-06 20:17:52 +01:00
|
|
|
ssl_session_cache shared:SSL:1m; # 1MB -> 4,000 sessions
|
|
|
|
ssl_buffer_size 1400; # 1400 bytes to fit in one MTU
|
|
|
|
|
2014-09-06 20:32:37 +02:00
|
|
|
ssl_dhparam /etc/ssl/certs/dhparam.pem;
|
|
|
|
ssl_protocols {{ nginx_tls_protocols }};
|
|
|
|
ssl_ciphers "{{ tls_cipher_suite }}";
|
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
|
2014-12-06 21:21:46 +01:00
|
|
|
# OCSP stapling...
|
|
|
|
ssl_stapling on;
|
|
|
|
ssl_stapling_verify on;
|
|
|
|
resolver 8.8.4.4;
|
|
|
|
|
2014-12-06 20:37:00 +01:00
|
|
|
# nginx does not auto-rotate session ticket keys: only a HUP / restart will do so and
|
|
|
|
# when a restart is performed the previous key is lost, which resets all previous
|
|
|
|
# sessions. The fix for this is to setup a manual rotation mechanism:
|
|
|
|
# http://trac.nginx.org/nginx/changeset/1356a3b9692441e163b4e78be4e9f5a46c7479e9/nginx
|
|
|
|
#
|
|
|
|
# Note that you'll have to define and rotate the keys securely by yourself. In absence
|
|
|
|
# of such infrastructure, consider turning off session tickets:
|
|
|
|
ssl_session_tickets off;
|
|
|
|
|
2014-12-06 20:40:39 +01:00
|
|
|
# enable SPDY header compression
|
|
|
|
spdy_headers_comp 6;
|
|
|
|
|
2014-09-06 20:32:37 +02:00
|
|
|
# Enable this if you want HSTS (recommended, but be careful)
|
2015-01-24 10:40:48 +01:00
|
|
|
add_header Strict-Transport-Security max-age=15768000 always;
|
2014-09-06 20:32:37 +02:00
|
|
|
|