由 IIS 7 代理的 RhodeCode

发布于 2024-12-11 09:34:23 字数 1224 浏览 0 评论 0原文

我在 Windows 2008R2(64 位)机器上安装了 RhodeCode 1.2.2。

我已将 IIS 7 设置为在 127.0.0.1:5000 运行的 RhodeCode 的代理服务器(应用程序请求路由 + URL 重写)。

可通过“https://subdomain.domain.de”访问存储库。

在存储库摘要中,克隆 URL 指向: https://[username]@127.0.0.1:5000/SomeProject

在客户端,我可以在替换时克隆存储库 “127.0.0.1:5000”与“subdomain.domain.de”。

当然,我希望 RhodeCode 显示代理 url (“subdomain.domain.de”)而不是 127.XXX...

我在网上上下搜索,我唯一发现的是 Apache 有一个“ProxyPreserveHost On”设置,可以解决这个问题。然而 我没有找到 IIS 的类似内容。

“生产.ini”中是否有某个设置可以让我 定义代理网址? 或者有人发现了 IIS 中隐藏的设置吗?

非常感谢您的帮助:-)


感谢您的回答!我已经使用了 ARR 并设置了反向代理,我可以通过代理访问 RhodeCode。但是,HTTP_HOST 值似乎没有转发到 Paster。

在 IIS 中,我设置了以下服务器变量,并将它们设置在反向代理规则中:

<set name="HTTP_HOST" value="[subdomain.domain.de]" />
<set name="HTTP_X_FORWARDED_SERVER" value="[subdomain.domain.de]" />
<set name="HTTP_X_ORIGINAL_HOST" value="[subdomain.domain.de]" />
<set name="HTTP_X_HTTP_HOST" value="[subdomain.domain.de]" />
<set name="HTTP_X_URL_SCHEME" value="https" />

但这根本没有影响。

在之前链接的答案中,他建议将这些变量值复制回HTTP_HOST(在tomcat内,在我的情况下应该是粘贴的)。与 apache 中简单的“ProxyPreserveHost On”相比,这对我来说看起来有点过分了。我有一种感觉,我在这里错过了一些东西。

干杯, 索恩特

I installed RhodeCode 1.2.2 at a Windows 2008R2 (64Bit) box.

I had setup a IIS 7 as a Proxy Server (Application Request Routing + URL Rewrite) for RhodeCode running at 127.0.0.1:5000.

The Repository is reachable via "https://subdomain.domain.de".

At the repository summary, the Clone url points to:
https://[username]@127.0.0.1:5000/SomeProject

At the client side, I can clone the repository when replacing the
"127.0.0.1:5000" with "subdomain.domain.de".

For sure I would like that RhodeCode displays the Proxy url
("subdomain.domain.de") instead of the 127.XXX...

I search the web up and down and the only thing I found, was that
Apache has a "ProxyPreserveHost On" setting, which does the trick. However
I didn't found anything like that for IIS.

Is there somewhere a setting within the "production.ini" where I can
define the proxy url?
Or does someone found the well hidden setting within the IIS?

Any help is much appreciated :-)


thanks for your answer! I already use the ARR and setup the reverse proxy, I can access RhodeCode via the proxy. However, it looks like that the HTTP_HOST value is not forwarded to paster.

Within the IIS, I setup the following server variables and set them within the reverse proxy rule:

<set name="HTTP_HOST" value="[subdomain.domain.de]" />
<set name="HTTP_X_FORWARDED_SERVER" value="[subdomain.domain.de]" />
<set name="HTTP_X_ORIGINAL_HOST" value="[subdomain.domain.de]" />
<set name="HTTP_X_HTTP_HOST" value="[subdomain.domain.de]" />
<set name="HTTP_X_URL_SCHEME" value="https" />

but that have no affect at all.

At the linked previously answer, he suggested to copy these variable values back to the HTTP_HOST (within tomcat, should be paster in my case). That looks a bit overkilled to me, in comparsion to a simple "ProxyPreserveHost On" within apache. I have the feeling that I missed something here.

Cheers,
Sörnt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

似狗非友 2024-12-18 09:34:23

Itvan 是对的,那会起作用的。

取消注释clone_uri 将保留默认的clone_uri。您可以通过以下行强制 clone_uri 使用您的域:

clone_uri = {scheme}://{user}{pass}[subdomain.domain.de]{path}

PS:适用于版本 1.3.6

Itvan is correct, that will work.

Uncommenting the clone_uri will leave the default clone_uri. You can force the clone_uri to use your domain by having that line:

clone_uri = {scheme}://{user}{pass}[subdomain.domain.de]{path}

PS: Works on version 1.3.6

︶葆Ⅱㄣ 2024-12-18 09:34:23

我正在为 rhodecode 开发 https 反向代理apache 现在在 centos6 上。

对于 Apache,rhodecode 名望的 marcin 指出的配置是:

<VirtualHost *:80>
    ServerName hg.myserver.com
    ServerAlias hg.myserver.com

    <Proxy *>
      Order allow,deny
      Allow from all
    </Proxy>

    #important !
    #Directive to properly generate url (clone url) for pylons
    ProxyPreserveHost On

    #rhodecode instance
    ProxyPass / http://127.0.0.1:5000/
    ProxyPassReverse / http://127.0.0.1:5000/

    #to enable https use line below
    #SetEnvIf X-Url-Scheme https HTTPS=1
</VirtualHost>

有关 ProxyPreserveHost 的 IIS 等效项,请参阅 应用程序请求路由,在 MSFT MVP 之前的回答

http服务器实际上是python Paste的httpserver,所以参考python Paste文档对于httpserveregg#Paste:http很熟悉吧),没有代理配置。您必须 IIS 中的反向代理 (来源

我不确定为什么 marcin 选择建议设置反向代理而不是使用 Paste 的 httpserver支持https;但让 IIS 处理请求,并将粘贴的 httpserver 绑定到 127.0.0.1 可能是最佳选择。

I'm working on out reverse proxying over https for rhodecode with apache on centos6 right now.

For Apache, the configuration noted by marcin of rhodecode fame is:

<VirtualHost *:80>
    ServerName hg.myserver.com
    ServerAlias hg.myserver.com

    <Proxy *>
      Order allow,deny
      Allow from all
    </Proxy>

    #important !
    #Directive to properly generate url (clone url) for pylons
    ProxyPreserveHost On

    #rhodecode instance
    ProxyPass / http://127.0.0.1:5000/
    ProxyPassReverse / http://127.0.0.1:5000/

    #to enable https use line below
    #SetEnvIf X-Url-Scheme https HTTPS=1
</VirtualHost>

For the IIS equivilent of ProxyPreserveHost, see Application Request Routing, which was provided in a previously answer by a MSFT MVP.

The http server is actually python paste's httpserver, so referring to the python paste documentation for httpserver (egg#Paste:http is familiar right), there is no proxy configuration. You will have to reverse proxy in IIS (source)

I am unsure why marcin has opted to advise setting up the reverse proxy versus utilizing paste's httpserver support for https; but having IIS field the requests, and binding paste's httpserver to 127.0.0.1 is likely best choice.

生死何惧 2024-12-18 09:34:23

我刚刚安装了 RhodeCode 1.3.3 并遇到了这个问题。您可以在配置文件中编辑此行以使其正常工作:

## overwrite schema of clone url
## available vars:
## scheme - http/https
## user - current user
## pass - password 
## netloc - network location
## path - usually repo_name

#clone_uri = {scheme}://{user}{pass}{netloc}{path}

clone_uri = {scheme}://{user}{pass}yourdomain.com{path}

I've just installed RhodeCode 1.3.3 and got into this issue. You can edit this line in configuration file to make it work:

## overwrite schema of clone url
## available vars:
## scheme - http/https
## user - current user
## pass - password 
## netloc - network location
## path - usually repo_name

#clone_uri = {scheme}://{user}{pass}{netloc}{path}

clone_uri = {scheme}://{user}{pass}yourdomain.com{path}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文