【发布时间】:2012-08-12 20:48:08
【问题描述】:
我正在尝试在 Nginx 中验证多个位置以及 proxy_pass。 Nginx 配置如下:
server {
listen 443;
server_name example.com;
location /hg/ {
rewrite ^/hg/(.*)$ /$1 break;
proxy_pass http://127.0.0.1:8001;
auth_basic "hg";
auth_basic_user_file hg.htpasswd;
location /hg/repo1/ {
auth_basic "hg-repo1";
auth_basic_user_file repo1.htpasswd;
}
location /hg/repo2/ {
auth_basic "hg-repo2";
auth_basic_user_file repo2.htpasswd;
}
}
}
身份验证工作正常,但代理在嵌套位置(repo1、repo2)被破坏。似乎 proxy_pass 配置没有被继承。因此,Nginx 返回 404(在 /hg/repo1 和 /hg/repo2 上)。
有什么提示吗?
【问题讨论】:
标签: mercurial proxy nginx hgweb proxypass