Created
November 24, 2021 13:32
-
-
Save lynsei/5449f61aea4a70fd27403f9bfcf878d7 to your computer and use it in GitHub Desktop.
#nginx #ssl #productionized #pm2
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
upstream my_nodejs_upstream { | |
server 127.0.0.1:3001; | |
keepalive 64; | |
} | |
server { | |
listen 443 ssl; | |
server_name www.my-website.com; | |
ssl_certificate_key /etc/ssl/main.key; | |
ssl_certificate /etc/ssl/main.crt; | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_pass http://my_nodejs_upstream/; | |
proxy_redirect off; | |
proxy_read_timeout 240s; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment