我需要一个 Nginx 的重写规则,它将重写以下所有图像:
http://mysite.com/index.php/article/foo/images/image.(png|jpg|gif)
讲话:
http://mysite.com/images/image.(png|jpg|gif)
答案1
你会想要类似这样的东西:
rewrite ^/index.php/article/foo/images/(.*).(png|jpg|gif) /images/$1.$2 ;
我需要一个 Nginx 的重写规则,它将重写以下所有图像:
http://mysite.com/index.php/article/foo/images/image.(png|jpg|gif)
讲话:
http://mysite.com/images/image.(png|jpg|gif)
你会想要类似这样的东西:
rewrite ^/index.php/article/foo/images/(.*).(png|jpg|gif) /images/$1.$2 ;