Nginx支持webSocket配置
2017-09-04 10:32
357 查看
在nginx.conf文件中增加以下配置即可
upstream wsbackend {
server 127.0.0.1:3000;
}
server {
listen 8090;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
# location / {
# root html;
# index index.html index.htm;
# }
location / {
proxy_pass http://wsbackend; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
upstream wsbackend {
server 127.0.0.1:3000;
}
server {
listen 8090;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
# location / {
# root html;
# index index.html index.htm;
# }
location / {
proxy_pass http://wsbackend; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
相关文章推荐
- 配置nginx支持websocket基础文献
- 配置Nginx支持WSS(WebSocket)
- 阿里云负载不支持 WebSocket 协议与 WSS 和 Nginx 配置问题
- nginx配置支持websocket
- Nginx之websocket配置,支持ssl
- Nginx发布Alias虚拟目录及PHP支持配置方法
- nginx安装配置、Nginx支持php
- opensuse nginx+mono 2.8支持aspx环境的配置
- nginx 配置支持 thinkphp pathinfo
- nginx中配置跨域支持功能
- 配置nginx使之支持pathinfo
- nginx安装及配置支持php的教程(全)
- 配置NGINX支持中文URL 中文文件名称或文件夹404无法訪问的解决方法
- nginx使用ssl模块配置HTTPS支持
- nginx配置支持http2
- StartCom 申请 SSL 证书及 Nginx HTTPS 支持配置全攻略
- 简单配置nginx使之支持pathinfo
- nginx配置支持php的pathinfo模式配置方法
- nginx配置将http请求转发支持ssl双向认证https请求的正向代理
- centos下配置nginx支持php