我在我的DMZ中運行反向代理(RP)服務器(Win 2012 R2)。然後連接到運行Win 2008 R2的LAN服務器。我在另一個Win 2012 R2 LAN盒子前也有相同的RP服務器。500 URL重寫模塊錯誤ASP.NET Core
我們正在局域網背後的RP上部署我們的第一個ASP.NET Core應用程序。它的作品完美是LAN盒子是Win 2012 R2。但是,如果我們將應用程序移動到我們的Win 2008 R2生產機器上,它將起作用,除非有控制器返回HTML視圖(而不是XML或JSON)。同樣,完全相同的代碼在Win 2012 R2 LAN盒子上工作,但不是Win 2008 R2 LAN盒子。
這裏的RP web.config文件(同爲除了IP地址和域名都LAN服務器)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://10.0.0.254/{R:1}" />
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://10.0.0.254/(.*)" />
<action type="Rewrite" value="http{R:1}://our-public-domain.com/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
就贏2008 R2 LAN中,這裏的web.config中:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\MyApp.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 5x8x39x8-580x-4xx2-955x-76x4x4685415-->
正如我所說的,當連接到Win 2012 R2或Win 2008 R2盒子時,在同一RP服務器上的配置。另外,我們在Window 2008 R2上有其他不使用ASP.NET Core的站點,這些站點工作得很好,但沒有任何視圖,因爲它們只是返回XML,JSON和文本。
任何見解?
任何變化剃刀頁沒有複製到生產服務器?試圖獲得剃鬚刀頁面時遇到的任何錯誤? –