Files
reader-star/apps/admin/nginx.conf
rjl 9d801ba6b4 refactor(admin): 移除待定排名页面并更新配置
- 删除待定排名页面及相关路由配置
- 更新环境变量配置,调整API地址和主页路由
- 添加vite-auto-deploy依赖和nginx配置文件
- 更新组件类型定义,移除未使用的组件
- 调整页面标题和图片资源
2026-03-13 09:39:49 +08:00

35 lines
976 B
Nginx Configuration File

server {
listen 80;
server_name localhost;
# 设置根目录为打包后的 dist 文件夹
root /usr/share/nginx/html;
index index.html;
# 开启 gzip 压缩
gzip on;
gzip_min_length 1k;
gzip_comp_level 6;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
# 核心配置:处理 SPA 路由 fallback
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";
}
# 代理接口配置(如果需要)
# location /api/ {
# proxy_pass http://backend-api.com/;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# }
}