88 lines
2.6 KiB
Plaintext
Raw Normal View History

2026-05-12 15:07:34 +02:00
upstream app {
server app:10500;
}
2026-06-08 17:38:33 +02:00
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
2026-06-08 22:51:09 +02:00
map $uri $upload_disposition {
default "attachment";
"~*\.(jpe?g|png|gif|webp|bmp|tiff|mp4|webm|ogv|mov|m4v|mp3)$" "inline";
}
2026-05-16 01:28:39 +02:00
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=app_cache:10m max_size=${NGINX_CACHE_MAX_SIZE} inactive=60m use_temp_path=off;
2026-05-12 15:07:34 +02:00
server {
listen 80;
server_name _;
2026-06-08 17:38:33 +02:00
client_max_body_size ${NGINX_MAX_BODY_SIZE};
2026-05-12 15:07:34 +02:00
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options DENY;
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy strict-origin-when-cross-origin;
gzip on;
gzip_types text/plain text/css text/javascript application/javascript application/json image/svg+xml;
gzip_min_length 1000;
gzip_vary on;
gzip_proxied any;
2026-06-08 17:38:33 +02:00
location /static/uploads/ {
alias /app/static/uploads/;
add_header X-Content-Type-Options nosniff;
2026-06-08 22:51:09 +02:00
add_header Content-Disposition $upload_disposition;
2026-06-08 17:38:33 +02:00
add_header Cache-Control "public, max-age=604800";
access_log off;
log_not_found off;
}
2026-05-12 15:07:34 +02:00
location /static/ {
alias /app/static/;
expires 7d;
add_header Cache-Control "public, immutable, max-age=604800";
access_log off;
log_not_found off;
}
2026-06-08 17:38:33 +02:00
location /devii/ws {
proxy_pass http://app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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_read_timeout 3600s;
proxy_send_timeout 3600s;
}
2026-05-12 15:07:34 +02:00
location /avatar/ {
proxy_pass http://app;
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://app;
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_http_version 1.1;
proxy_set_header Connection "";
proxy_connect_timeout 30s;
proxy_read_timeout 60s;
proxy_send_timeout 60s;
${NGINX_CACHE_CONFIG}
}
}