server { listen 80; server_name h5.dev.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"; } }