nginx配置支持websocket
来源:互联网 发布:软件发布 编辑:程序博客网 时间:2024/06/08 04:37
找到nginx.conf
把这两行配置加上就可以了
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
放在自己server里的location ~ / {
}里面。
例如
server {
listen 80;
server_name xxx.mmm.com;
charset utf-8;
index /index.jsp;
location ~* ^.+\.(log|jpg|jpeg|gif|png|ico|html|cfm|cfc|afp|asp|lasso|pl|py|txt|fla|swf|zip)$ {
root /data/project/erp-crm-tj-web/code;
expires 1d;
}
location ~* ^.+\.(js|css|less)$ {
root /data/project/erp-crm-tj-web/code;
expires 2h;
}
location ~ / {
proxy_pass http://121.153.197.176:13982;
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_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
add_header Pragma "no-cache";
add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
}
}
- nginx配置支持websocket
- Nginx支持webSocket配置
- nginx支持websocket
- nginx配置websocket
- nginx转发websocket配置
- Nginx WebSocket代理配置
- nginx websocket配置
- Nginx配置WebSocket
- Nginx 配置 WebSocket
- nginx支持websocket及websocket部分原理介绍
- Nginx支持php配置
- Nginx支持PHP配置
- nginx支持php配置
- 配置Nginx支持php
- 配置nginx支持PATH_INFO
- 配置nginx支持 PATH_INFO
- Nginx支持php配置
- Nginx支持PHP配置
- SQL Server 事务隔离级别详解
- CODESOFT6 二维码中追加回车
- Django来敲门~第一部分【4. 创建第一个模块应用】
- hibernate 连接超时
- Plug-in 编辑器
- nginx配置支持websocket
- 使用git克隆指定分支的代码
- 给TextView添加行分割线
- OpenGL蓝宝书源码学习(十五)第六章——FlatShader.cpp
- 普元NUI使用参考文档以及示例
- 如何在CentOS 7上修改主机名hostname
- 如何在十分钟内插入1亿条记录到Oracle数据库?
- Mybatis.xml文件设置自动提醒
- walsh-Hadamard变换