您的位置:首页 > 运维架构 > Nginx

nginx 某个url或者url下面的图片不能访问就跳到指定的url

2011-05-31 08:32 579 查看
server_name house.xaklc.com;
index index.php index.html index.htm;
root /data1/web1site/web/house;
location ~ ^/attachments/.*\.(php|php5)$
{
deny all;
}
location ~ ^/data/.*\.(php|php5)$
{
deny all;
}

location ~* ^/attachments/.*\.(jpg|gif|bmp|jpeg|png)$ {
if (!-e $request_filename) {
rewrite ^/(.*) /static/images/nophotosmall.gif last;
}
}

http://house.xak1c.com/attachments/****/***/*** 图片类型的文件不能访问均跳到 http://house.xak1c.com/static/images/nophotosmall.gif
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息