尝试通过 IIS 反向代理通过 https 访问 UpSource returns 一个空页面

Trying to access UpSource over https via IIS Reverse Proxy returns an empty page

我目前正在尝试设置各种 Jetbrains 服务,以便使用 IIS 反向代理通过 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/, all I get is an empty page titled "Upsource". No error message. Not even a Fav Icon. Accessing UpSource via 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 已经在做的那样工作?

如有任何帮助,我们将不胜感激。

在 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。还是有问题,不过与本题主题无关,我单独开一个题。

注意:在 IIS 8.5 上将 HTTP1.1 设置为 ARR PROXY-Settings。否则 websocket 连接,但没有通信。

upsource 诉 upsource-2018.2.1291

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