1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| server { listen 80; server_name <domain>;
rewrite ^ https://$server_name$request_uri? permanent; }
server { listen 443;
proxy_ssl_protocols TLSv1.2 TLSv1.3; proxy_ssl_ciphers DEFAULT;
server_name <domain>;
access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log info;
keepalive_timeout 75 75;
ssl on; ssl_certificate <path-to-ssl-cert>; ssl_certificate_key <path-to-ssl-key>; ssl_session_timeout 5m; ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security "max-age=7200"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;
location / { proxy_pass http://<local-or-remote-addr>:<port>; } }
|