nginx websocket proxy

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}
upstream websocket {
    server 127.0.0.1:2346;
}
server {
        listen              80 default;
       。。。。。
        location = /socket.php {
            proxy_pass http://websocket;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

}

  

posted @ 2017-08-01 11:18  hao.ma  阅读(275)  评论(0编辑  收藏  举报