basti Wrote:
-------------------------------------------------------
> Hello,
> 
> i have a URL like
> 
> https://example.com/foo/doc/bar/filename.txt
> 
> I want to deny access to all files and folders in /doc/...
> and try

> location ~ ^/foo/(doc|etc|lib|log|sbin|var/cache|var/lib|var/log)/ {
>   deny all;
> }

Maybe something like:

map $uri $locn {
  default  0;
  ~*/foo/   1;
  ~*/doc/  1;
}

location / {
if ($locn) { return 404; }
}

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,256652,256663#msg-256663

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to