我正在尝试使用反向IIS代理在单个服务器上通过https设置UpSource,以及YouTrack、TeamCity和Hub。
情况如下:
UpSource的http版本位于http://server.company.com:8081/upsource,运行正常。我希望它可以通过https://server.company.com/upsource访问。但是,虽然可以通过https地址访问UpSource,但连接会立即中断,并出现以下错误消息:
Backend is not available
TypeError: Failed to fetch我发现这个错误是奇怪和混乱的,考虑到后端似乎是可用的和运行的,因为http://server.company.com:8081/upsource工作得很好。
至于我的配置,我主要是按照the documentation中概述的步骤进行设置的,在需要的地方进行了修改,以说明我们有四个JetBrains服务运行在一台服务器上并通过相同的IIS反向代理。
IIS代理的当前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 Hub" stopProcessing="true">
<match url="^hub(.*)" />
<action type="Rewrite" url="http://server.company.com:8082/hub{R:1}" />
<serverVariables>
<set name="HTTP_X_FORWARDED_HOST" value="{HTTP_HOST}" />
<set name="HTTP_X_FORWARDED_SCHEMA" value="https" />
<set name="HTTP_X_FORWARDED_PROTO" value="https" />
</serverVariables>
</rule>
<rule name="Reverse Proxy to YouTrack" stopProcessing="true">
<match url="^youtrack(.*)" />
<action type="Rewrite" url="http://server.company.com:8080/youtrack{R:1}" />
<serverVariables>
<set name="HTTP_X_FORWARDED_HOST" value="{HTTP_HOST}" />
<set name="HTTP_X_FORWARDED_SCHEMA" value="https" />
<set name="HTTP_X_FORWARDED_PROTO" value="https" />
</serverVariables>
</rule>
<rule name="Reverse Proxy to UpSource" stopProcessing="true">
<match url="^upsource(.*)" />
<action type="Rewrite" url="http://server.company.com:8081/upsource{R:1}" />
<serverVariables>
<set name="HTTP_X_FORWARDED_HOST" value="{HTTP_HOST}" />
<set name="HTTP_X_FORWARDED_SCHEMA" value="https" />
<set name="HTTP_X_FORWARDED_PROTO" value="https" />
</serverVariables>
</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>
<security>
<requestFiltering>
<requestLimits maxUrl="6144" maxQueryString="4096" />
</requestFiltering>
</security>
</system.webServer>
</configuration>正如我所提到的,这在TeamCity和Hub上已经很好用了。然而,对于UpSource来说,似乎还缺少一些东西,这可能与"TypeError: Failed to fetch“有关。我已经试着去查过了,但是到目前为止还没有找到任何有用的信息。
如果任何人有任何想法来解决这个问题,我将非常乐意得到关于这个问题的更多意见
发布于 2018-04-09 13:57:20
好的,所以我想出了怎么做:
web.config的上述配置实际上是正确的。但是,还需要按正确的顺序执行以下步骤:
注意:所有以hub.bat开头的命令都需要在[Hub Installation Directory]\bin中的hub.bat文件上执行,所有以upsource.bat开头的命令都需要在[UpSource Installation Directory]\bin中的upsource.bat文件上执行。
upsource.bat stop
hub.bat stop
hub.bat configure --listen-port 8082 --base-url https://server.company.com/hub
upsource.bat configure --listen-port 8081 --base-url=https://server.company.com/upsource --hub-url=https://server.company.com/hub/hub
hub.bat start
upsource.bat start --J-Dbundle.websocket.compression.enabled=false注意:我不知道为什么,但是集线器在它的基地址后附加了一个额外的/hub,这就是为什么UpSource的集线器-url设置以/hub/hub结尾。
在那之后,我需要做的就是将重定向URL添加到集线器>设置>服务> UpSource中允许的UpSource重定向URL列表中,现在它可以完美地工作了。
嗯,几乎是完美的。每当服务器重新启动时,我都需要手动重新启动UpSource,因为我还没有想出用--J-Dbundle.websocket.compression.enabled=false参数将upsource注册为服务的方法,但除此之外,一切都运行得很好。
https://stackoverflow.com/questions/49644222
复制相似问题