如何解决连接被拒绝错误Nginx Flask_socketio,Flask应用
我正在尝试在NGINX服务器上托管聊天应用程序,但出现错误。我在Ubuntu服务器上运行,并且在客户端显示400错误的错误请求。
*71 connect() failed (111: Connection refused) while connecting to upstream,client: 193.36.225.4,server: xxx.xxx.xxx.xxx,request: "GET /socket.io/?EIO=3&transport=polling&t=NGV-jAk HTTP/1.1",upstream: "http://127.0.0.1:5001/socket.io/?EIO=3&transport=polling&t=NGV-jAk",host: "xxx.xxx.xxx.xxx",referrer: "http://xxx.xxx.xxx.xxx/"
NGIX文件:
upstream socketio_nodes {
ip_hash;
#server http://unix:/home/web_chatbot/web_chatbot.sock/socket.io:/socket.io/;
server 127.0.0.1:5000;
server 127.0.0.1:5001;
server 127.0.0.1:5002;
# to scale the app,just add more nodes here!
}
server {
listen 80;
server_name 000.000.000.000;
location / {
include proxy_params;
proxy_pass http://127.0.0.1:5000;
}
location /static {
alias /home/web_chatbot/web_chatbot/static;
expires 30d;
}
location /socket.io {
include proxy_params;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://socketio_nodes/socket.io;
}
}
点子要求:fask,fask_socketio,gunicorn,eventlet
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。