39 lines
887 B
Plaintext
39 lines
887 B
Plaintext
upstream django_backend {
|
|
server django_web_prod:8000 max_fails=3 fail_timeout=30s;
|
|
server web:8000 backup;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
client_max_body_size 100M;
|
|
|
|
location / {
|
|
proxy_pass http://django_backend;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_redirect off;
|
|
|
|
# Connection settings
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
location /static/ {
|
|
alias /app/staticfiles/;
|
|
expires 30d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
location /media/ {
|
|
alias /app/media/;
|
|
expires 7d;
|
|
add_header Cache-Control "public";
|
|
}
|
|
}
|
|
|
|
|