Commit 2ed629ac by zhangxingmin

push

parent 17c31fdb
......@@ -5,42 +5,29 @@ server {
root /usr/share/nginx/html;
index index.html;
# 禁用缓存确保获取最新资源
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
add_header Pragma "no-cache";
expires 0;
# Vue路由模式支持
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-store, no-cache, must-revalidate"; # 禁用缓存
}
# 匹配manifest.json中的base路径
location /cffp/ {
alias /usr/share/nginx/html/;
try_files $uri $uri/ /cffp/index.html;
}
# 代理API请求
location /cffpApi {
proxy_pass http://cffpApi;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# 错误日志
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# 错误页面
error_page 404 /404.html;
location = /404.html {
internal;
# 禁止访问 .env 文件
location ~ /\.env {
deny all;
return 404;
}
# 错误处理
error_page 500 502 503 504 /50x.html;
location = /50x.html {
internal;
root /usr/share/nginx/html;
}
# 访问日志
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}
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