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

2015-01-08 Thread carlg
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; }#allo

Re: How to use Nginx to restrict access to everyfiles to 127.0.0.1, except the php files in /

2015-01-08 Thread carlg
Here is what i found to achieve this : i denied access to every php files : location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; allow 127.0.0.1;

Re: How to use Nginx to restrict access to everyfiles to 127.0.0.1, except the php files in /

2014-11-13 Thread carlg
Hi, It works, but i am still able to access the php files inside the restricted directories. I tried with : location /myfolder/(.+)\.php$ { deny all; } But this doesn't work! Also, i cannot make this method work nice with our clean url's. We are using : location / { #try_fil

How to use Nginx to restrict access to everyfiles to 127.0.0.1, except the php files in /

2014-11-12 Thread carlg
HI, I want to configure our nginx to be a little more paranoid concerning file access. Right now, i am using rules like : location /includes { allow 127.0.0.1; deny all; } ... but i need to repeat this kind of rules for every folders, and then restrict access to the php files inside. So our rul