pop68315 发表于 2012-7-27 16:59:54

求教LNMPA中如何禁止htaccess被下载?

LNMPA应该是nginx做的前端,所以
<Files .htaccess>
order allow,deny
deny from all
</Files>

这句在.htaccess里面不起作用,然后就是在nginx中禁止,但是我在:/usr/local/nginx/conf/nginx.conf 和 /usr/local/nginx/conf/vhost/域名.conf 中都加入了如下配置
location ~ .*\.(ftpquota|htaccess|htpasswd)?\$ {
deny all;
}

保存,重启nginx,无效。。。请问这是为什么?

bobofan1995 发表于 2012-7-27 18:10:30

你禁止的是目录……

bobofan1995 发表于 2012-7-27 18:10:34

你禁止的是目录……

pop68315 发表于 2012-7-28 08:15:03

原帖由 bobofan1995 于 2012-7-27 18:10 发表 https://bbs.vpser.net/images/common/back.gif
你禁止的是目录……


您好 能具体说一下么,谢谢。。。

licess 发表于 2012-7-28 08:23:24

参考 https://www.vpser.net/security/lnmp-remove-nginx-php-execute.html

pop68315 发表于 2012-7-28 14:38:29

原帖由 licess 于 2012-7-28 08:23 发表 https://bbs.vpser.net/images/common/back.gif
参考 https://www.vpser.net/security/lnmp-remove-nginx-php-execute.html

感谢军哥
少加/.
这样可以

location ~ /.*\.(htaccess)?$ {
deny all;
}
页: [1]
查看完整版本: 求教LNMPA中如何禁止htaccess被下载?