Fill nginx config with working settings
All checks were successful
Deploy MES Core / deploy (push) Successful in 8s

This commit is contained in:
2026-03-27 22:00:59 +03:00
parent 297dcd9a3c
commit ab03b101f5

42
nginx/default.conf Normal file
View File

@@ -0,0 +1,42 @@
upstream django_app {
server web:8000;
}
server {
listen 80;
# Добавляем конкретный домен и IP сервера
server_name shiftflow.tertelius.space 192.168.1.108 localhost;
# Максимальный размер загружаемого файла
client_max_body_size 100M;
# Сжатие (Gzip) — ускорит загрузку интерфейса
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml;
location / {
proxy_pass http://django_app;
# Передаем оригинальный хост (важно для ALLOWED_HOSTS)
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# КРИТИЧНО для CSRF защиты в Django
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
}
location /static/ {
alias /app/staticfiles/;
expires 30d;
add_header Cache-Control "public, no-transform";
}
location /media/ {
alias /app/media/;
expires 30d;
add_header Cache-Control "public, no-transform";
}
}