nginx支持websocket
2016-08-18 21:35
501 查看
1、修改配置文件nginx.conf
fastcgi_intercept_errors on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream tomcat.apps {
server 127.0.0.1:8080 weight=1;
}
include vhost/*.conf;
2、修改域名配置文件www_handansoft_com.conf
location / {
proxy_pass http://tomcat.apps;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
红色部分为新增内容
fastcgi_intercept_errors on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream tomcat.apps {
server 127.0.0.1:8080 weight=1;
}
include vhost/*.conf;
2、修改域名配置文件www_handansoft_com.conf
location / {
proxy_pass http://tomcat.apps;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
红色部分为新增内容
相关文章推荐
- nginx代理指定目录
- 访问Nginx发生SSL connection error的一种情况
- ICANN 推迟批准 .Org 交易
- 2015-2016网页设计趋势分析 Web Design of Trends
- 黑客攻破域名注册商 Web.com 安全防线,客户私密信息或被泄露
- Nginx+Naxsi部署专业级Web应用防火墙
- CentOS 6.2实战部署Nginx+MySQL+PHP
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- dns。dhcp,ftp
- Nginx 学习笔记(一)
- 网站502与504错误分析
- 用zabbix监控nginx_status状态
- 提高域名信任度的8个小技巧[推荐]
- .ME域名国内预注册开始
- CEPA 搭桥引路 HK域名直击香港市场
- .tel域名正式开放注册 把握先机赢商机