fix: nginx serves uploaded assets directly, docker volumes for all public dirs
Deploy to VPS / deploy (push) Has been cancelled

This commit is contained in:
2026-04-08 17:07:49 +00:00
parent 80bb1962b2
commit c5b78c539e
5 changed files with 74 additions and 9 deletions
+6 -2
View File
@@ -59,8 +59,6 @@ services:
SMTP_SECURE: ${SMTP_SECURE}
NODE_ENV: production
volumes:
- ./public/footage:/app/public/footage
- ./public/applications:/app/public/applications
- ./public/cases:/app/public/cases
@@ -84,6 +82,12 @@ services:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./certbot/conf:/etc/letsencrypt:ro
- ./certbot/www:/var/www/certbot:ro
- ./public/cases:/srv/cases:ro
- ./public/applications:/srv/applications:ro
- ./public/news:/srv/news:ro
- ./public/parts:/srv/parts:ro
- ./public/footage:/srv/footage:ro
- ./public/operations-inbox:/srv/operations-inbox:ro
depends_on:
- app
networks:
+68 -7
View File
@@ -43,13 +43,6 @@ server {
access_log off;
}
location /footage/ {
proxy_pass http://nextjs;
expires 30d;
add_header Cache-Control "public";
access_log off;
}
location /hq-command/login {
limit_req zone=login burst=10 nodelay;
proxy_pass http://nextjs;
@@ -59,6 +52,31 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
# Asset uploads (large files, long timeout)
location /api/assets {
client_max_body_size 500M;
proxy_pass http://nextjs;
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 600s;
proxy_send_timeout 600s;
proxy_request_buffering off;
}
location /api/public-upload {
client_max_body_size 500M;
proxy_pass http://nextjs;
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 600s;
proxy_send_timeout 600s;
proxy_request_buffering off;
}
location /hq-command/ {
proxy_pass http://nextjs;
proxy_set_header Host $host;
@@ -86,6 +104,49 @@ server {
access_log off;
}
# Serve uploaded assets directly from disk (bypass Next.js)
location /cases/ {
alias /srv/cases/;
expires 30d;
add_header Cache-Control "public";
access_log off;
}
location /applications/ {
alias /srv/applications/;
expires 30d;
add_header Cache-Control "public";
access_log off;
}
location /news/ {
alias /srv/news/;
expires 30d;
add_header Cache-Control "public";
access_log off;
}
location /parts/ {
alias /srv/parts/;
expires 30d;
add_header Cache-Control "public";
access_log off;
}
location /operations-inbox/ {
alias /srv/operations-inbox/;
expires 7d;
access_log off;
}
location /footage/ {
alias /srv/footage/;
expires 30d;
add_header Cache-Control "public";
access_log off;
}
location / {
proxy_pass http://nextjs;
proxy_set_header Host $host;
Binary file not shown.

After

Width:  |  Height:  |  Size: 470 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB