From 08624eb9be12a7307b000cf69ee4d97846e272b5 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 25 Nov 2025 09:33:44 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20nginx.conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..afa81fa --- /dev/null +++ b/nginx.conf @@ -0,0 +1,41 @@ +server { + listen 80; + server_name h5.paipai.life; + + root /usr/share/nginx/html; + index index.html; + + # 设置客户端请求体超时时间 + client_body_timeout 300s; + + # API 代理配置 - 对应 proxy.ts 中的配置 + location /api/v1/ { + proxy_pass https://rn-master:8088/api/v1/; # 根据实际后端服务地址调整 + 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_connect_timeout 300s; + proxy_send_timeout 300s; + proxy_read_timeout 300s; + + # 代理缓冲区设置 + proxy_buffering off; + proxy_request_buffering off; + } + + # 单页应用路由配置 + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + # 静态资源缓存配置 + location /static { + expires 7d; + add_header Cache-Control "public, no-transform"; + } +}