Files
hoopscout/nginx/nginx.conf
2026-03-10 13:06:12 +01:00

57 lines
1.5 KiB
Nginx Configuration File

worker_processes auto;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
client_max_body_size 20m;
upstream django_upstream {
server web:8000;
}
server {
listen 80;
server_name _;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "same-origin" always;
location /static/ {
alias /var/www/static/;
expires 30d;
add_header Cache-Control "public, max-age=2592000, immutable";
access_log off;
}
location /media/ {
alias /var/www/media/;
expires 7d;
add_header Cache-Control "public, max-age=604800";
access_log off;
}
location /health/ {
proxy_pass http://django_upstream/health/;
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;
}
location / {
proxy_pass http://django_upstream;
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;
}
}
}