如何在 nginx 中最小化重定向单个 url?
How to minimize redirects single url in nginx?
如何将此类请求最小化?
location = /GetFile.ashx {
return 301 /overview-videos/;
}
location = /products/GetFile.ashx {
return 301 /overview-videos/;
}
location = /abouts/GetFile.ashx {
return 301 /overview-videos/;
}
Nginx的简单解决方案:
location ~ ^/(.*)GetFile.ashx$ {
return 301 /overview-videos/;
}
如何将此类请求最小化?
location = /GetFile.ashx {
return 301 /overview-videos/;
}
location = /products/GetFile.ashx {
return 301 /overview-videos/;
}
location = /abouts/GetFile.ashx {
return 301 /overview-videos/;
}
Nginx的简单解决方案:
location ~ ^/(.*)GetFile.ashx$ {
return 301 /overview-videos/;
}