From d10c7885356909145ffa4ba7c2ed8a91d85f48f2 Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Thu, 19 Mar 2026 12:42:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AEnginx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 1 + nginx.conf | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 844277a..9ad80db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ FROM node:22.14.0-alpine3.21 AS production-stage WORKDIR /app RUN apk add --no-cache nginx ffmpeg +ENV NODE_ENV=production COPY --from=build-stage /app /app COPY nginx.conf /etc/nginx/nginx.conf diff --git a/nginx.conf b/nginx.conf index c0ca833..2cb2411 100644 --- a/nginx.conf +++ b/nginx.conf @@ -20,7 +20,7 @@ http { server_name localhost; location /api/ { - proxy_pass http://127.0.0.1:3000/video_translate/api/; + proxy_pass http://127.0.0.1:3000/api/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -31,13 +31,9 @@ http { } location / { - alias /app/dist/; + root /app/dist; index index.html; - try_files $uri $uri/ /video_translate/index.html; + try_files $uri $uri/ /index.html; } - - location = /video_translate { - return 301 /video_translate/; - } } }