Switch to UWSGI and make docker build/run smarter

This commit is contained in:
2022-10-18 07:22:22 +01:00
parent 5cba45e0a7
commit e121b135a2
6 changed files with 71 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
upstream django {
#server app:8000;
server unix:///var/run/socks/app.sock;
#server unix:///var/run/socks/app.sock;
server app:8000;
}
server {
@@ -9,11 +10,10 @@ server {
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /code/core/;
root /conf;
}
location / {
include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed
proxy_pass http://django;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View File

@@ -0,0 +1,24 @@
upstream django {
server app:8000;
#server unix:///var/run/socks/app.sock;
}
server {
listen 9999;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /conf;
}
location / {
include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed
uwsgi_pass django;
uwsgi_param Host $host;
uwsgi_param X-Real-IP $remote_addr;
uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
}
}