我目前正在尝试使用 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>
此外,我还按照文档中的说明配置了以下服务器变量:
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 一样工作?
对此的任何帮助将不胜感激。