feat: 构建cicd | docke部署 | nginx 配置文件

This commit is contained in:
lzh
2025-12-18 12:04:23 +08:00
parent 76198be3d3
commit b2e831155c
4 changed files with 240 additions and 0 deletions

33
apps/web-antd/nginx.conf Normal file
View File

@@ -0,0 +1,33 @@
server {
listen 80;
server_name localhost; # 通配符,匹配所有域名(适用于反向代理场景)
# 开启 gzip 压缩
gzip on;
gzip_min_length 1k;
gzip_comp_level 6;
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
root /usr/share/nginx/html;
index index.html;
# 解决 SPA 路由刷新 404 问题
location / {
try_files $uri $uri/ /index.html;
}
# 静态资源缓存配置
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
}
# 错误页面
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}