Files
geMoldInsight/deploy/nginx/frontend.conf
T
cjw 65b33609d6 fix(deploy): frontend nginx client_max_body_size 1m→100M(修 /api/upload 413)
上传 STP 文件被 nginx 默认 1m 限制挡住,返回 413 Content Too Large。
与 .env MAX_FILE_SIZE=104857600(100MB)对齐;同步把 proxy_read/send_timeout
提到 300s,避免大文件反代中途断流。

部署机还需在外层 nginx(gemj.cn:443 那台)也加:
  client_max_body_size 100M;
否则外层 nginx 会先于容器返回 413。
2026-09-26 21:18:16 +08:00

54 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
upstream gemold_backend_upstream {
server backend:8000;
}
server {
listen 8000;
server_name _;
# 与 .env MAX_FILE_SIZE=104857600(100MB)对齐;nginx 默认 1m 会直接 413
client_max_body_size 100M;
# 大文件上传给后端足够时间(默认 60s,100MB 可能不够)
proxy_read_timeout 300s;
proxy_send_timeout 300s;
root /usr/share/nginx/html;
index index.html;
location /assets/ {
try_files $uri =404;
access_log off;
expires 30d;
add_header Cache-Control "public, max-age=2592000, immutable";
}
location /api/ {
proxy_pass http://gemold_backend_upstream;
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;
}
location /health {
proxy_pass http://gemold_backend_upstream;
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;
}
location /html/ {
proxy_pass http://gemold_backend_upstream;
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;
}
location / {
try_files $uri $uri/ /index.html;
}
}