天天看点

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

                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)$ 

                location ~* ^/attachments/.*\.(jpg|gif|bmp|jpeg|png)$ { 

                    if (!-e $request_filename) {           

                                rewrite ^/(.*)  /static/images/nophotosmall.gif last;

                        }

本文转自 liang3391 51CTO博客,原文链接:http://blog.51cto.com/liang3391/577990