Commit a54c6570350d3d969a575473f9c6911758b3a09a
1 parent
68c24c78a8
Exists in
master
Changed nginx.conf and run_production.sh to run the websockets server
Showing 2 changed files with 12 additions and 0 deletions Side-by-side Diff
nginxconf/flashy.cards
View file @
a54c657
... | ... | @@ -3,6 +3,10 @@ |
3 | 3 | server localhost:7002; |
4 | 4 | } |
5 | 5 | |
6 | +upstream websocket_production { | |
7 | + server localhost:7001; | |
8 | +} | |
9 | + | |
6 | 10 | server { |
7 | 11 | |
8 | 12 | server_name flashy.cards; |
... | ... | @@ -28,6 +32,13 @@ |
28 | 32 | location ^~ /app/ { |
29 | 33 | alias /srv/flashy-frontend/; |
30 | 34 | try_files $uri /app/home.html; |
35 | + } | |
36 | + | |
37 | + location /ws/ { | |
38 | + proxy_http_version 1.1; | |
39 | + proxy_set_header Upgrade $http_upgrade; | |
40 | + proxy_set_header Connection "upgrade"; | |
41 | + proxy_pass http://websocket_production; | |
31 | 42 | } |
32 | 43 | |
33 | 44 | location ~ /(api|admin|api-auth)/ { |
scripts/run_production.sh
View file @
a54c657
... | ... | @@ -2,5 +2,6 @@ |
2 | 2 | source secrets.sh |
3 | 3 | source venv/bin/activate |
4 | 4 | # newrelic-admin run-program /srv/flashy-backend/venv/bin/gunicorn --pid /run/flashy/gunicorn.pid -w 6 -n flashy -b 127.0.0.1:7002 flashy.wsgi |
5 | +uwsgi /etc/uwsgi/websocket.ini --touch-reload=/etc/uwsgi/websocket.ini & | |
5 | 6 | newrelic-admin run-program uwsgi /etc/uwsgi/flashy.ini --touch-reload=/etc/uwsgi/flashy.ini |