关闭

configure websocket forward in nginx

标签: nginx
27人阅读 评论(0) 收藏 举报
分类:

server
{
listen 80;
server_name mydomain.com.cn;

*#all incoming packets occured in 80*
**location /**{
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://122.XXX.XXX.XXX:8090;
    *#match ws content and construct http shakehand packet*
    **location /chatRoom/** {
        proxy_pass http://122.XXX.XXX.XXX:8090;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
access_log logs/galaxy.access.log;

}

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:73次
    • 积分:30
    • 等级:
    • 排名:千里之外
    • 原创:2篇
    • 转载:1篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档