Nginx支持webSocket配置

来源:互联网 发布:网络模块接入电话信号 编辑:程序博客网 时间:2024/06/10 00:26

在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";        }    }


原创粉丝点击