Jul172014
linux+nginx下禁止某目录执行php
修改NG网站配置文件。
禁止单目录:
location ~ /attachments/.*.(php|php5)?$ {
deny all;
}
禁止多目录:
location ~ /(attachments|upload)/.*.(php|php5)?$ {
deny all;
}
经测试貌似没用? 会把目录内其他文件都屏蔽不能访问。比如upload里面的图片都不能访问了。求解。
解决方案:http://shanmao.me/webservice/nginx/nginx-xian-zhi-wang-zhan-dan-mu-lu-zhi-xing-php
本文固定链接: http://shanmao.me/webservice/linux/linux-nginx-xia-jin-zhi-mou-mu-lu-zhi-xing-php | 山猫的博客