gpt4 book ai didi

IIS 等效于 "proxy_set_header X-Forwarded-Proto https;"

转载 作者:行者123 更新时间:2023-12-04 22:42:13 25 4
gpt4 key购买 nike

NGINX 中此配置的 IIS 等价物是什么?
proxy_set_header X-Forwarded-Proto https;
我在 Windows 服务器上运行 JetBrains YouTrack,使用 IIS 作为终止 SSL 代理,并在尝试登录时收到此错误:

HTTP ERROR 405

Problem accessing /hub/auth/login. Reason:

HTTP method POST is not supported by this URL
Powered by Jetty://

我的 web.config 看起来像这样:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Reverse Proxy" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" />
<!-- Redirect all requests to non-HTTPS site. -->
<action type="Rewrite" url="http://my.youtrack.site/{R:1}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
<handlers>
<clear />
<!-- No other handlers required. Must clear them otherwise ASP.NET might try to intercept *.svc paths etc. -->
<add name="Rewrite" path="*" verb="*" modules="RewriteModule" resourceType="Unspecified" />
</handlers>
</system.webServer>
</configuration>

我正在尝试遵循以下来源的解决方案: https://confluence.jetbrains.com/display/YTD65/Linux.+JAR+in+Nginx+Web+Server , 但对于 IIS

最佳答案

找到后解决https://confluence.jetbrains.com/display/YTD65/Configuring+Proxy#ConfiguringProxy-IISreverseproxy

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Reverse Proxy" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" />
<!-- Redirect all requests to non-HTTPS site. -->
<action type="Rewrite" url="http://my.youtrack.site/{R:1}" logRewrittenUrl="true" />
<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>
</rules>
<allowedServerVariables>
<add name="HTTP_X_FORWARDED_HOST" />
<add name="HTTP_X_FORWARDED_SCHEMA" />
<add name="HTTP_X_FORWARDED_PROTO" />
</allowedServerVariables>
</rewrite>
<handlers>
<clear />
<!-- No other handlers required. Must clear them otherwise ASP.NET might try to intercept *.svc paths etc. -->
<add name="Rewrite" path="*" verb="*" modules="RewriteModule" resourceType="Unspecified" />
</handlers>
</system.webServer>
</configuration>

关于IIS 等效于 "proxy_set_header X-Forwarded-Proto https;",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34680786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com