nginx中怎样指定多个目录不解析php



 location /data/attachment/ {
    location ~ .*\.(php)?${
        deny all;
    }
}

搜了半天给的例子都是这样的
每个目录都复制一遍的就太那啥了吧...

nginx centos

麻宫雅典娜 10 years, 2 months ago

修改 php.ini


 open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/

也可以做到这个功能

狗駒邑沙季 answered 10 years, 2 months ago


 location ~ (/data/attachment/|/xxoo/|/ooxx/oxox) {
    location ~ .*\.(php)?${
        deny all;
    }
}

正则啊

netcat answered 10 years, 2 months ago

Your Answer