diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 5b68c06..e05e489 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -2,6 +2,9 @@ server { listen 80; server_name _; + # Allow large uploads (e.g. videos) + client_max_body_size 300m; + root /usr/share/nginx/html; index index.html; @@ -14,10 +17,21 @@ server { location /api/ { proxy_pass http://backend:8080/; proxy_http_version 1.1; - proxy_set_header Host $host; + # Keep original Host (incl. port) so backend can generate correct absolute URLs + proxy_set_header Host $http_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; } -} + # Serve uploaded files via backend static route + location /static/ { + proxy_pass http://backend:8080/static/; + proxy_http_version 1.1; + proxy_set_header Host $http_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_buffering off; + } +}