如何禁止访问某些文件?
之前在mapn下验证有效的规则,到lnmp里都无效了,htaccess和xml文件始终是可以访问到的比如:
location ~ /errors/.*\.(xml|phtml)?$ { deny all; }
或者 location /errors/.*\.(xml|phtml)?$ { deny all; }
还有
location ~ .*\.(ftpquota|htaccess|htpasswd|asp|aspx|jsp|asa|mdb)?$ {
deny all;
}
我把自带的规则修改下,也无效
location ~ .*\.(js|css)?$
{
expires 12h;
}
换个扩展名,改成
location ~ .*\.(htaccess|xml)?$
{
deny all;
}
不解
把deny all; 换成 return 403; 还是可以访问.htaccess和xml文件
[ 本帖最后由 hvbirder 于 2011-7-15 16:13 编辑 ] 写的没错,但是为什么不生效呢 重装了下,规则又生效了
页:
[1]