1
在我的重定向規則中,我有一個導致www2
網站的路徑。www www2重定向的路徑nginx
重定向到其他www
類型的網站工作正常,所以我想知道是否有什麼特別的東西我需要在這裏添加,我失蹤了。我需要清除緩存以傳播這些更改嗎?
location/{
#This one doesn't work?
if ($request_filename ~ /foo0) {
rewrite^http://www2.example.com/foo0 permanent;
}
#Works fine
if ($request_filename ~ /foo1) {
rewrite^http://sub1.example.com/? permanent;
}
#Works fine
if ($request_filename ~ /foo2) {
rewrite^http://sub2.example.com/? permanent;
}
#All other requests good.
if (!-f $request_filename) {
rewrite ^(.*)$ /index.php last;
}
}
[如果是邪惡的(http://wiki.nginx.org/IfIsEvil) – rvighne