自动部署
Some checks failed
构建并部署 H5 前端 / build-and-deploy (push) Has been cancelled

This commit is contained in:
2026-01-22 17:16:16 +08:00
parent 777265209a
commit 43dfc0f9e0
4 changed files with 217 additions and 0 deletions

41
docker/nginx.conf Normal file
View File

@@ -0,0 +1,41 @@
server {
listen 80;
server_name localhost;
# gzip 压缩
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
# 静态资源目录
root /usr/share/nginx/html;
index index.html;
# 健康检查端点
location /health {
access_log off;
return 200 'ok';
add_header Content-Type text/plain;
}
# 静态资源缓存JS/CSS/图片)
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
access_log off;
}
# Vue Router history 模式支持
location / {
try_files $uri $uri/ /index.html;
}
# 禁止访问隐藏文件
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}