nginx禁止访问某个文件和目录(文件夹)

nginx禁止访问所有.开头的隐藏文件设置

location ~* /\.* {
deny all;
}

nginx禁止访问目录,

例如:禁止访问path目录

location ^~ /path {
deny all;
}

可以把path换成实际需要的目录,目录path后是否带有”/”,带”/”只禁止访问目录,不带”/”禁止访问目录中的文件

转载请保留:http://www.nginx.cn/125.html

14 thoughts on “nginx禁止访问某个文件和目录(文件夹)

  1. Pingback: Pre-Market Stocks Gold Silver Update Today New Futures Exchange for Gold

  2. Pingback: dang nhap w88top

  3. Pingback: Accidente Fatal Choque

  4. Pingback: custom aircraft decals

  5. Pingback: Replica Rolex Milgauss

  6. Pingback: i99bet

  7. Pingback: commercial roofing specialists

  8. Pingback: paragnost

  9. Pingback: พนันบอลออนไลน์

  10. Pingback: www.rajaqq8.com

  11. Pingback: elangqq login

  12. Pingback: porn

  13. Pingback: 안전바카라

  14. Pingback: bed bug extermination

Comments are closed.