Browse Source

roles/nginx: add tls 1.2 support

python3
Zolfa 5 years ago
parent
commit
e8383499bd
Signed by: zolfa GPG Key ID: E1A43B038C4D6616
2 changed files with 5 additions and 1 deletions
  1. +1
    -0
      roles/nginx/defaults/main.yml
  2. +4
    -1
      roles/nginx/templates/base.j2

+ 1
- 0
roles/nginx/defaults/main.yml View File

@ -4,4 +4,5 @@ monitoring_vhosts: []
nginx_site_fqdn: '{{ ansible_hostname }}.{{ domain }}'
nginx_site_alternate_fqdns: []
nginx_proxy_protocol: true
nginx_tls_1_2: false
...

+ 4
- 1
roles/nginx/templates/base.j2 View File

@ -27,7 +27,10 @@ server {
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
# modern configuration
ssl_protocols TLSv1.3;
ssl_protocols TLSv1.3 {{ 'TLSv1.2' if nginx_tls_1_2 }};
{% if nginx_tls_1_2 %}
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;
{% endif %}
ssl_prefer_server_ciphers off;
# HSTS (2 years, no preloading)
add_header Strict-Transport-Security "max-age=63072000" always;


Loading…
Cancel
Save