Created
December 29, 2017 02:38
-
-
Save chanjarster/b228c7f998d1d81a5797ec7bfbd24ad2 to your computer and use it in GitHub Desktop.
Nginx反向代理具有WebSocket应用的配置文件
This file contains 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
http { | |
// ssl 相关配置 ... | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
server { | |
listen 8020; | |
location /ws { | |
proxy_pass http://some-ip:8080; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
proxy_set_header Origin ""; | |
proxy_read_timeout 86400; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment