From 63c5ec7ac787d37ad5c01d3cd093d3bf5b6c69a2 Mon Sep 17 00:00:00 2001 From: Leon <147289645+LeoninCS@users.noreply.github.com> Date: Fri, 9 Jan 2026 21:08:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=BE=E5=BC=80=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E9=99=90=E5=88=B6=EF=BC=8C=E5=B9=B6=E8=AE=A9?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=8F=AF=E4=BB=A5=E8=AE=BF=E9=97=AE=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/nginx.conf | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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; + } +}