我目前正试图通过使用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然而,当我试图通过UpSource访问https://server.company.com/upsource/时,我得到的只是一个名为"Upsource“的空页面。没有错误信息。甚至连神像都没有。但是,通过http://server.company.com:8081/访问http://server.company.com:8081/仍然可以正常工作。
我也尝试过运行以下命令链:
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已经在做的那样工作呢?
如果能在这方面提供任何帮助,我们将不胜感激。
发布于 2018-04-04 06:22:59
在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。仍然有一个问题,但由于它与这个问题的主题无关,我将为它创建一个单独的问题。
发布于 2019-05-24 10:39:26
注意:在IIS8.5上,将HTTP1.1设置为ARR代理-设置。否则,websocket连接,但没有通信。
“上游诉上游”-2018.2.1291
https://www.jetbrains.com/help/upsource/proxy-configuration.html#IISreverseProxy
https://stackoverflow.com/questions/49570508
复制相似问题