Skip to content

Instantly share code, notes, and snippets.

@abersheeran
Created December 12, 2019 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abersheeran/7b625b1c86d3bf56909639d3dc1796f3 to your computer and use it in GitHub Desktop.
Save abersheeran/7b625b1c86d3bf56909639d3dc1796f3 to your computer and use it in GitHub Desktop.
Nginx 反向代理 websocket
server {
listen 443 ssl;
server_name websocks;
root html;
ssl_certificate /path/to/websocks.pem;
ssl_certificate_key /path/to/websocks.key;
ssl_session_timeout 5m;
location / {
proxy_pass http://127.0.0.1:8765;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment