【问题标题】:Trying to access UpSource over https via IIS Reverse Proxy returns an empty page尝试通过 IIS 反向代理通过 https 访问 UpSource 返回一个空页面
【发布时间】:2018-03-30 07:47:47
【问题描述】:

我目前正在尝试使用 IIS 反向代理设置各种 Jetbrains 服务以通过 https 使用。完整的预期设置应如下所示:

TeamCity: https://server.company.com           -> http://server.company.com
YouTrack: https://server.company.com/youtrack/ -> http://server.company.com:1234/issues/
Hub:      https://server.company.com/hub/      -> http://server.company.com:5678/hub/
UpSource: https://server.company.com/upsource/ -> http://server.company.com:9876

我已经使用以下配置为 TeamCity 和 YouTrack 实现了这个功能,但遇到了一些困难:

在 IIS 中,我有一个用作重定向的 TeamCity 网站。该站点的 web.config 目前如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="Reverse Proxy to TeamCity" stopProcessing="true">
                    <match url="^teamcity/(.*)" />
                    <action type="Rewrite" url="http://server.company.com/{R:1}" />
                </rule>
                <rule name="Reverse Proxy to YouTrack" stopProcessing="true">
                    <match url="^youtrack/(.*)" />
                    <action type="Rewrite" url="http://server.company.com:8080/issues/{R:1}" />
                </rule>
                <rule name="Reverse Proxy to Hub" stopProcessing="true">
                    <match url="^hub/(.*)" />
                    <action type="Rewrite" url="http://server.company.com:8082/hub/{R:1}" />
                </rule>
                <rule name="Reverse Proxy to UpSource" stopProcessing="true">
                    <match url="^upsource/(.*)" />
                    <action type="Rewrite" url="http://server.company.com:8081/{R:1}" />
                </rule>
                <rule name="Reverse Proxy to Collaboration General" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://server.company.com/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

另外,我已经按照documentation中的描述配置了以下服务器变量:

HTTP_X_FORWARDED_HOST
HTTP_X_FORWARDED_SCHEME
HTTP_X_FORWARDED_PROTO

但是,当尝试通过 https://server.company.com/upsource/ 访问 UpSource 时,我得到的只是一个标题为“Upsource”的空白页面。没有错误信息。甚至没有收藏图标。不过,通过http://server.company.com:8081/ 访问 UpSource 仍然可以正常工作。

我也已经尝试过运行以下命令链:

upsource.bat stop
upsource.bat configure --listen-port 8081 --base-url https://server.company.com:443/upsource/
upsource.bat start --J-Dbundle.websocket.compression.enabled=false

但是,这确实导致问题变为:

HTTP ERROR: 404
Problem accessing /bundle/starting. Reason:

Not Found
Powered by Jetty:// 9.3.20.v20170531

如何设置 UpSource 以像 TeamCity 和 Hub 一样工作?

对此的任何帮助将不胜感激。

【问题讨论】:

    标签: ssl iis https reverse-proxy upsource


    【解决方案1】:

    在帮助解决相关 YouTrack 错误的 YouTrack 支持员工的帮助下,我能够找出此问题背后的原因。

    原因是:当使用重定向路径通过 https 访问 UpSource 时,http 和 https 变体中的路径需要相同。

    简而言之,这是行不通的:

    https://server.company.com/upsource -> http://server.company.com:9876
    

    但这会:

    https://server.company.com/upsource -> http://server.company.com:9876/upsource
    

    我通过在 [InstDir]/bin 中的 upsource.bat 上运行以下配置命令来实现此功能:

    upsource.bat configure --listen-port 9876 --base-url http://server.company.com:9876/upsource
    

    现在我至少可以通过 https 连接并登录 UpSource。还是有问题,不过因为和本题的主题无关,所以我会单独为它创建一个问题。

    【讨论】:

    【解决方案2】:

    注意:在 IIS 8.5 上,在 ARR 代理设置中设置 HTTP1.1。否则 websocket 连接,但没有通信。

    upsource 诉 upsource-2018.2.1291

    https://www.jetbrains.com/help/upsource/proxy-configuration.html#IISreverseProxy

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-13
      • 2020-06-05
      • 2022-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多