location ^~ /ProductionManagement {
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
if ($request_method = 'OPTIONS') {
return 204;
}
# 如果路由中包含_CG则去掉_CG重定向到新url
if ($request_uri ~ ^(/ProductionManagement/.*)_CG(.*)$) {
# rewrite ^ $1$2 break;
return 301 http://127.0.0.1:8019$1$2;
}
alias html/ProductionManagement/;
index index.html index.htm;
try_files $uri $uri/ /ProductionManagement/index.html;
}
nginx重定向去掉url中的字符串
最新推荐文章于 2023-11-01 18:17:44 发布