d5dc499c6b
Deploy / deploy (push) Successful in 1m15s
nginx: - 新增 /api/v1/import/ 专属 location,proxy_read_timeout 延长至 300s 后端: - ImportInventory 预加载商品/仓库/库存(3 次 bulk query 替代 N+1) - 批量写 inventory_log(CreateInBatches 替代逐行 Create) 前端: - settings 导入行:显示"上传 XX%"进度条和"导入数据(Ns)"计时 - Dio 超时设置为 send=120s / receive=300s Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
60 lines
1.6 KiB
Plaintext
60 lines
1.6 KiB
Plaintext
server {
|
||
listen 127.0.0.1:8445 ssl;
|
||
server_name jiu.51yanmei.com;
|
||
|
||
ssl_certificate /etc/letsencrypt/live/jiu.51yanmei.com/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/jiu.51yanmei.com/privkey.pem;
|
||
ssl_protocols TLSv1.2 TLSv1.3;
|
||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||
|
||
client_max_body_size 20m;
|
||
|
||
# 商品图片静态文件
|
||
location ^~ /images/ {
|
||
alias /opt/jiu/images/;
|
||
expires 30d;
|
||
add_header Cache-Control "public, immutable";
|
||
}
|
||
|
||
# 文件导入接口(超时更长)
|
||
location ~ ^/api/v1/import/ {
|
||
proxy_pass http://127.0.0.1:8080;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
|
||
# API 反向代理
|
||
location ~ ^/(api|health|version) {
|
||
proxy_pass http://127.0.0.1:8080;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_read_timeout 30s;
|
||
}
|
||
|
||
# Flutter 管理端(仅 /app/ 前缀,不污染根路径)
|
||
location /app/ {
|
||
alias /opt/jiu/web/;
|
||
index index.html;
|
||
try_files $uri $uri/ /app/index.html;
|
||
}
|
||
|
||
# 扫码页(/scan/<id> → scan.html,JS 从 URL 读取 id)
|
||
location /scan/ {
|
||
root /opt/jiu/marketing;
|
||
try_files /scan.html =404;
|
||
}
|
||
|
||
# 营销站点兜底(根路径及所有其他路径)
|
||
location / {
|
||
root /opt/jiu/marketing;
|
||
try_files $uri $uri.html $uri/index.html /index.html;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name jiu.51yanmei.com;
|
||
return 301 https://$host$request_uri;
|
||
}
|