Files
dj52/nginx/default.conf
Beyhan Oğur ec28a2024d first commit
2026-04-26 22:22:29 +03:00

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";
}
}