VPS侦探论坛

 找回密码
 注册
查看: 6375|回复: 5

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

[复制链接]
发表于 2012-7-27 16:59:54 | 显示全部楼层 |阅读模式

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,无效。。。请问这是为什么?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-7-27 18:10:30 | 显示全部楼层


你禁止的是目录……
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-7-27 18:10:34 | 显示全部楼层

你禁止的是目录……
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-7-28 08:15:03 | 显示全部楼层



原帖由 bobofan1995 于 2012-7-27 18:10 发表
你禁止的是目录……



您好 能具体说一下么,谢谢。。。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-7-28 08:23:24 | 显示全部楼层

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2012-7-28 14:38:29 | 显示全部楼层

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


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

location ~ /.*\.(htaccess)?$ {
deny all;
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-23 13:28 , Processed in 0.026775 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表