Last active
April 20, 2021 17:15
-
-
Save vietanhduong/ac0489dc5d7d17f1b433898923233a9f to your computer and use it in GitHub Desktop.
nginx ssl config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com; | |
return 302 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name example.com; | |
ssl_certificate /etc/ssl/certs/example.pem; | |
ssl_certificate_key /etc/ssl/private/example.pem; | |
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; | |
ssl_prefer_server_ciphers on; | |
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | |
location / { | |
proxy_pass http://localhost:3000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection keep-alive; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment