Welcome! Log In Create A New Profile

Advanced

Re: How to deny access to a folder, but allow access to every subfolders (wildcard)

Raúl Galicia
January 08, 2015 08:26PM
El 2015-01-09 01:44, carlg escribió:
> Hi,
>
> I need to deny access to /members but allow access to every folders
> below.
>
> There may be a lot of folders, maybe a thousan, and each of those
> folders
> contain 5 other folders. So i need a wildcard.
>
> Here is what i tried :
>
> location ~ ^/members/([^/]+)/([^/?]+)$ { allow all; } #allow
> every folders below /members with wildcard
> location ~ ^/members/ { deny all; }
> #deny
> everything else
>
> But it doesn't work.


Hi,

This works for me... or I think so ;)

location ~* /members/.+/.* { allow all; }
location ~* /members/.* { deny all; }

Cheers,
Raúl Galicia

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

How to deny access to a folder, but allow access to every subfolders (wildcard)

carlg January 08, 2015 07:44PM

Re: How to deny access to a folder, but allow access to every subfolders (wildcard)

Raúl Galicia January 08, 2015 08:26PM

Re: How to deny access to a folder, but allow access to every subfolders (wildcard)

B.R. January 09, 2015 02:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 214
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