abab985769
- 后端新增中间件限制请求体最大为8MB,超出返回413错误 - nginx配置添加client_max_body_size为8m以支持8MB最大上传 - 更新favicon.svg图标样式 - 模型列表页默认分页大小由10改为50,提高一次加载条目数
34 lines
976 B
Nginx Configuration File
34 lines
976 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Gzip compression
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
|
|
# API proxy to backend (使用后端容器名和端口)
|
|
location /api {
|
|
proxy_pass http://backend:8000;
|
|
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;
|
|
|
|
# 允许上传最大 8MB 的文件
|
|
client_max_body_size 8m;
|
|
}
|
|
|
|
# Handle Vue Router history mode
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Cache static assets
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
}
|