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
+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;
@@ -85,6 +103,49 @@ server {
proxy_pass http://nextjs;
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;