From c817ea96b12f218f98e0c14c15c80165b3ebc15b Mon Sep 17 00:00:00 2001 From: qiuyechen <530937038@qq.com> Date: Mon, 12 Jan 2026 10:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20dist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/compose.yml | 11 +++++++++++ dist/nginx.conf | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 dist/compose.yml create mode 100644 dist/nginx.conf diff --git a/dist/compose.yml b/dist/compose.yml new file mode 100644 index 0000000..3250aa4 --- /dev/null +++ b/dist/compose.yml @@ -0,0 +1,11 @@ +version: '3.8' + +services: + web: + image: nginx + restart: always + volumes: + - ./dist:/usr/share/nginx/html # Ensure ./web/dist folder exists and contains built frontend files + - ./nginx.conf:/etc/nginx/conf.d/default.conf + ports: + - "9809:80" # Expose standard HTTP port, ensure WEB_PORT is defined in .env file \ No newline at end of file diff --git a/dist/nginx.conf b/dist/nginx.conf new file mode 100644 index 0000000..d901885 --- /dev/null +++ b/dist/nginx.conf @@ -0,0 +1,23 @@ +server { + listen 80; + server_name localhost; + client_max_body_size 10000M; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location /api/ { + proxy_pass http://172.17.0.1:16532/api/; + 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; + + # WebSocket support (关键配置) + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } +} \ No newline at end of file