Commit da4910db by zhangxingmin

push

parent 235d9bcd
......@@ -5,15 +5,26 @@ server {
root /usr/share/nginx/html;
index index.html;
# 确保正确的 MIME 类型
include /etc/nginx/mime.types;
# 静态资源直接返回,不经过 try_files
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y; # 静态资源缓存
add_header Cache-Control "public";
access_log off;
log_not_found off;
}
# 主应用路由(history 模式)
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
# 子应用 /cffp/ 路由(关键修正)
# 子应用 /cffp/ 路由
location /cffp/ {
try_files $uri $uri/ /index.html; # 改为指向根目录的 index.html
try_files $uri $uri/ /cffp/index.html;
}
# 禁止访问 .env 文件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment