赞
踩
nginx支持ws协议的配置
map $http_upgrade $connection_upgrade { default upgrade; '' close; } upstream BackendIotWs { server 10.0.0.110:7004 weight=1; } server { listen 80; server_name ws.iot.com; location / { try_files $uri $uri/ /index.html last; root "/usr/local/openresty/nginx/std/manage/"; index index.html index.htm; } location /ws/iot { proxy_pass http://BackendIotWs proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_read_timeout 3600s; proxy_connect_timeout 86400; proxy_ignore_client_abort on; } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。