码迷,mamicode.com
首页 > Web开发 > 详细

nginx websocket代理配置

时间:2020-02-26 18:55:02      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:oca   soc   sock   pst   localhost   upstream   nbsp   代理配置   nginx   

map $http_upgrade $connection_upgrade {
        default upgrade;
        ‘‘ close;
    }

   upstream linecloudwebsocket {
        server 127.0.0.1:9002;
    }
server{
   listen       80;
   server_name  localhost;    
    location /linecloud/socket {
             rewrite ^/linecloud/socket(.*)$ /$1 break;
            proxy_pass http://linecloudwebsocket;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
        }
}

 

nginx websocket代理配置

标签:oca   soc   sock   pst   localhost   upstream   nbsp   代理配置   nginx   

原文地址:https://www.cnblogs.com/rolayblog/p/12368159.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!