我正在构建与套接字相关的web应用程序。而且我的应用程序在没有https的情况下运行良好,如果它有https,它就不会连接。
作为对nginx的指导,必须配置额外的代理。
但我不知道是用什么方式配置的?
下面是如何在nginx上进行配置,请帮助我在openlitespeed上配置!
https://www.nginx.com/blog/nginx-nodejs-websockets-socketio/
server {
server_name app.domain.com;
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://socket_nodes;
}
}
location /assets {
alias /path/to/assets;
access_log off;
expires max;
}非常感谢!
发布于 2019-02-18 09:01:21
检查这个维基,它是为火箭聊天而做的,但是websocket过程是一样的。
https://serverfault.com/questions/954419
复制相似问题