st1905
#1
Hello,
location ~ /admin/
Above matches every admin folder on the domain but i just want to match
“/admin” on the url like http://domain.com/admin
Tried this location = /admin/
But that did not work. I`m suing this location to password protect.
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,131021,131021#msg-131021
st1905
#2
How to match every php file under the admin directory? Thanks. I dont
want to match admin folder globally on the domain.
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,131021,131035#msg-131035
st1905
#3
On Thu, Sep 16, 2010 at 12:37:01PM -0400, st1905 wrote:
Hello,
location ~ /admin/
Above matches every admin folder on the domain but i just want to match
“/admin” on the url like http://domain.com/admin
Tried this location = /admin/
But that did not work. I`m suing this location to password protect.
location = /admin
–
Igor S.
http://sysoev.ru/en/
st1905
#4
Ok, solved this, just in case anyone needs the solution, here it is.
location /admin {
auth_basic "Restricted";
auth_basic_user_file /path/to/.htpasswd;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass my-backend;
}
}
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,131021,131044#msg-131044
st1905
#5
On Thu, Sep 16, 2010 at 01:15:45PM -0400, st1905 wrote:
How to match every php file under the admin directory? Thanks. I dont
want to match admin folder globally on the domain.
location ~ ^/admin/.+.php$
–
Igor S.
http://sysoev.ru/en/
st1905
#6