Welcome! Log In Create A New Profile

Advanced

Re: Restrict/Deny access to all paths starting with _

Marcus Clyne
January 22, 2010 05:50AM
Hi,

Smrchy wrote:
> Hi,
> this is probably a noob question but i'm wondering what would be the
> best way to
>
> allow access to a directory e.g.:
>
> location /foo {
> ...
> }
>
> this will allow access to
>
> /foo
> /foo/bar
> /foo/bar/somefile.txt
>
> But now i want to deny access to everything starting with /foo/_
location /foo {
...
}

location ^~ /foo/_ {
return 403;
}

should do the trick (and should be the most efficient I believe).

Marcus.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Restrict/Deny access to all paths starting with _

Smrchy January 22, 2010 05:14AM

Re: Restrict/Deny access to all paths starting with _

Marcus Clyne January 22, 2010 05:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 190
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready