【发布时间】:2012-05-20 21:07:11
【问题描述】:
我正在尝试从以下位置重定向: http://domain.com/public/photos/large/test.jpg 至: http://domain.com/images/public/photos/large/test.jpg 在 NGINX 环境中。
我的 vhost 文件配置如下。 我的问题是这样的语法不起作用:
server {
........
rewrite ^(public/photos/(.*)) http://domain.com/images/$1 last;
location / {
location ~.*\.(3gp|jpg|jpeg|gif)$ {
expires 7d;
try_files $uri @backend;
}
}
..........
}
rewriterule 语法在 .htaccess 环境中进行了测试,现在已经运行了 2 年多。在 nginx 上它不再存在了。
有什么想法吗? 10 倍
【问题讨论】:
标签: .htaccess url-rewriting nginx