0
我們有一系列較小的APIs是較大系統的一部分,每個都在IIS機器上的各自站點中運行。Owin URL重寫到不同的端口
要隱藏我們的內部架構,我們已經創建了一系列的IIS重寫規則:
<rule name="AuthServer" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^auth/.*" />
<action type="Rewrite" url="https://localhost:4000/{R:0}" />
</rule>
然而,我們需要擴大這一系統並使其可測試。
我們試過:
if (context.Request.Uri.AbsoluteUri.EndsWith("test"))
{
context.Request.Path = new PathString("/rewritten");
}
但這隻能讓我們改變路徑。我們需要重寫到不同的端口/站點。
可以這樣做嗎?