update Nginx configuration for SSL support and add DH parameters
This commit is contained in:
@ -15,7 +15,7 @@ upstream frontend
|
||||
|
||||
server
|
||||
{
|
||||
listen 80;
|
||||
listen 443 ssl; # managed by Certbot
|
||||
|
||||
server_tokens off;
|
||||
server_name crm.logidex.ru www.crm.logidex.ru;
|
||||
@ -24,6 +24,40 @@ server
|
||||
gzip_comp_level 4;
|
||||
gzip_types text/css application/javascript image/svg+xml application/json text/plain text/xml;
|
||||
|
||||
|
||||
ssl_certificate /var/www/certbot/live/crm.logidex.ru/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /var/www/certbot/live/crm.logidex.ru/privkey.pem; # managed by Certbot
|
||||
|
||||
add_header Strict-Transport-Security "max-age=63072000" always;
|
||||
|
||||
|
||||
# intermediate configuration
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ecdh_curve X25519:prime256v1:secp384r1;
|
||||
ssl_session_cache shared:le_nginx_SSL:10m;
|
||||
ssl_session_timeout 1440m;
|
||||
ssl_session_tickets off;
|
||||
ssl_prefer_server_ciphers off;
|
||||
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";
|
||||
|
||||
ssl_dhparam /var/www/certbot/live/crm.logidex.ru/dhparam.pem; # managed by Certbot
|
||||
|
||||
|
||||
# OCSP stapling
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
# verify chain of trust of OCSP response using Root CA and Intermediate certs
|
||||
ssl_trusted_certificate /var/www/certbot/live/crm.logidex.ru/chain.pem;
|
||||
|
||||
# replace with the IP address of your resolver;
|
||||
# async 'resolver' is important for proper operation of OCSP stapling
|
||||
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
||||
resolver_timeout 5s;
|
||||
|
||||
|
||||
|
||||
|
||||
# Общие proxy_set_header, унаследованные всеми location
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@ -71,4 +105,16 @@ server
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
if ($host = crm.logidex.ru) {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
server_name git.logidex.ru;
|
||||
listen 80;
|
||||
return 404; # managed by Certbot
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user