nginx websocket代理配置
Posted Rolay
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx websocket代理配置相关的知识,希望对你有一定的参考价值。
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代理配置的主要内容,如果未能解决你的问题,请参考以下文章