indj 发表于 2011-6-10 19:02:54

nginx 目录底下文件禁止访问怎么做?

location ^~ /home/wwwroot/www.xdianying.com/Tpl/q/Home
   {
   deny    all;
   }
网上搜到上面代码加入配置文件重启nginx,html文件照样可以访问:Q
有没有可用的代码?最好是禁止某个目录下包含下一层目录这种功能。

[ 本帖最后由 indj 于 2011-6-10 20:31 编辑 ]

licess 发表于 2011-6-10 19:36:06

加在fastcgi那个location的前面才起作用吧。

indj 发表于 2011-6-10 20:24:57

加在前面了还是无效能访问到html

licess 发表于 2011-6-10 21:50:02

你写的配置有问题吧
location ~ /(attachments|upload)/.*\.html?$ {
deny all;
}
页: [1]
查看完整版本: nginx 目录底下文件禁止访问怎么做?