nginx 代理 websocket

Posted on 2016-08-26 09:04  NooBkey  阅读(97)  评论(0)    收藏  举报

server {
    listen 80;
    root /home/chl/chat;
    index index.html index.htm;
 
    server_name _;
 
    location / {
        proxy_pass http://localhost:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
}

引用地址:https://chrislea.com/2013/02/23/proxying-websockets-with-nginx/

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3