Commit 69010b4978c24ae7ee8e971d6116825dea59e5d7
Exists in
master
Merge branch 'master' of git.ucsd.edu:110swag/flashy-backend
Showing 5 changed files Side-by-side Diff
flashy/wsgi.py
View file @
69010b4
flashy/wsgi_django.py
View file @
69010b4
flashy/wsgi_websocket.py
View file @
69010b4
nginxconf/flashy.cards
View file @
69010b4
... | ... | @@ -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 @
69010b4
... | ... | @@ -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 |