|
|
|
|
АРХИВ :: nginx-ru
|
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Странности с auth_basic и ревра йтом
- To: nginx-ru@xxxxxxxxx
- Subject: Странности с auth_basic и ревра йтом
- From: Александр Сытар <sytar.alex@xxxxxxxxx>
- Date: Mon, 30 Nov 2009 23:39:45 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=DDHklikni9rQtPfxGyf3nIHD1etmhqDY8lqOa4Jp5Iw=; b=Sm9hlljiuEc5Td9wYDCECYF8A2QQyp13fTvf++hE/AmrXhUCNVmdYezD9SGMGyax81 ZDA+Njmg5aJL35KGTqVNRzuxxB5IMaJhOqsIsSNaOBBlJqnodw9FQ9ThX9XP8dZwnl8/ 6nh5lsbdy2IpdtIAI20UQP7paFjbA+1LIWrEU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=CnehxUk9FfKHuq1akOLiHhnnzHZICowpJUu92Ugq7UDJKQJfBWGF5MxNdYrYz7QEop gYkFUxoNy1L7VaxScHDGcCHmOOTrmBPznRevz8R7pK3lzLXC88Wis8MrHMRlBvWDbTWP JGEwTs2AptUCL8WUyEpyJkOXkRQ/GT3g0xzLY=
Мог бы кто-нибудь объяснить странность поведения следующей конфигурации (0.7.64):
location = / { rewrite ^ /index.php$uri last; }
location /admin { auth_basic "Resticted Area"; auth_basic_user_file .htpasswd;
root /path/to/site/root; rewrite ^ /index.php$uri last # <- epic fail, входим без пароля }
location / { try_files $uri /index.php$uri; }
/location ~* \.php$ { fastcgi_pass backend;
}
debug log: 009/11/30 23:17:57 [notice] 13487#0: *25 "^" matches "/admin", client: 89.178.81.78, server: examle.ru, request: "GET /admin HTTP/1.1", host: " www.example.ru"
2009/11/30 23:17:57 [notice] 13487#0: *25 rewritten data: "/index.php/admin", args: "", client: 89.178.81.78, server:
.ru, request: "GET /admin HTTP/1.1", host: "www.
Однако если сделать так, то всё работает как и задумывалось.
location /admin { auth_basic "Resticted Area"; auth_basic_user_file .htpasswd; root /path/to/site/root; try_files $uri /index.php$uri; # <- работает как и должно, запрос пароля.
}
debug log:
[notice] 15504#0: *148 "^/(.*)$" matches "/admin", client: 89.178.81.78, server:
example .ru, request: "GET /admin HTTP/1.1", host: " example .ru"
2009/11/30 23:36:57 [notice] 15504#0: *148 rewritten redirect: " http://www. example
.ru/admin", client: 89.178.81.78, server: 3321045.ru, request: "GET /admin HTTP/1.1", host: "
example .ru"
Как же надо по правильному это сделать? Sent from Moscow, Mow, Russia
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
|
|
|