nginx 配置: server { listen 80; server_name 服务器地址; charset utf-8; client_max_body_size 75M;
location / {
root /root/dist;
index index.html;
try_files $uri $uri/ /index.html;
}
location /api/ {
uwsgi_pass 127.0.0.1:8001;
include /etc/nginx/uwsgi_params;
}
location /ws/ {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
} nginx 配置:
[uwsgi]
chdir = /root/....
home = /root/....
module = ....
master = True
processes = 2
harajiri = 60
max-requests = 5000
socket = 127.0.0.1:8001
uid = root
gid = root
pidfile = /root/master.pid
daemonize = /root/conf/logs/uwsgi_hzmj.log
vacuum = True
log-maxsize = 102400
buffer-size = 65536
websocket 报错:
WebSocket connection to 'ws://服务器地址 /ws/index/data/' failed: Error during WebSocket handshake: Unexpected response code: 502
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.