Last active
August 23, 2018 01:32
-
-
Save yangfch3/10b2252171f957c9d9192aaa321cb7f9 to your computer and use it in GitHub Desktop.
Nginx 为 Node.js 反向代理
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 nodejs8000 { | |
| server 127.0.0.1:8000; | |
| keepalive 64; | |
| } | |
| server { | |
| listen 80; | |
| listen 443; | |
| server_name web-dev.youguogame.com; | |
| ssl on; | |
| ssl_certificate relatedPath/to/ssl; | |
| ssl_certificate_key relatedPath/to/ssl_key; | |
| ssl_session_timeout 10m; | |
| ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
| ssl_session_cache shared:SSL:10m; | |
| location / { | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header Host $http_host; | |
| proxy_set_header X-Nginx-Proxy true; | |
| proxy_set_header Connection ""; | |
| proxy_pass http://nodejs8000; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment