Skip to content

Commit 6c7aa86

Browse files
Update uwsgi config
1 parent 231bdf3 commit 6c7aa86

2 files changed

Lines changed: 24 additions & 13 deletions

File tree

nginx.conf

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@ server {
1111
# }
1212

1313
location /api/ {
14-
proxy_set_header Host $host;
15-
proxy_pass http://localhost:5000/api/;
14+
include uwsgi_params;
15+
uwsgi_pass 127.0.0.1:5000;
1616
}
1717

1818
location /socket.io/ {
19-
proxy_http_version 1.1;
20-
proxy_buffering off;
21-
proxy_set_header Upgrade $http_upgrade;
22-
proxy_set_header Connection "upgrade";
23-
proxy_set_header Host $host;
24-
proxy_set_header X-Real-IP $remote_addr;
25-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26-
proxy_set_header X-Forwarded-Proto $scheme;
27-
proxy_read_timeout 86400;
28-
proxy_pass http://127.0.0.1:5000/socket.io/;
19+
include uwsgi_params;
20+
uwsgi_pass 127.0.0.1:5000;
21+
22+
# WebSocket support
23+
uwsgi_read_timeout 86400;
24+
uwsgi_send_timeout 86400;
2925
}
3026

3127
location / {

services.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
cd /usr/share/nginx/backend/ && uwsgi --disable-logging --http :5000 --gevent 1000 --http-websockets --master --wsgi-file __main__.py --callable app -s 0.0.0.0:3030 -b 23000 &
1+
#!/bin/bash
2+
cd /usr/share/nginx/backend/
3+
4+
# Start uWSGI with socket (not HTTP) for nginx uwsgi_pass
5+
uwsgi --socket 127.0.0.1:5000 \
6+
--protocol uwsgi \
7+
--gevent 1000 \
8+
--gevent-monkey-patch \
9+
--master \
10+
--wsgi-file __main__.py \
11+
--callable app \
12+
--processes 1 \
13+
--threads 1 \
14+
--buffer-size 32768 \
15+
--lazy-apps &
16+
217
nginx -g 'daemon off;'

0 commit comments

Comments
 (0)