[英]Url rewrite in IIS for different domain to call multiple service based on url
我有多個服務在域 abc.com 上的服務器上運行,我的 web 應用程序在不同的服務器 xyz.com 上運行。 我有一個要求,其中我需要以這樣的方式編寫 urlrewrite,如果我鍵入
url 怎么改寫呢?
我正在使用 IIS 版本 10 window 服務器 2022
您可以嘗試使用反向代理,以下案例可以作為參考:
<rewrite>
<rules>
<rule name="Reverse Proxy to service1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{SERVER_PORT}" pattern="1234" />
</conditions>
<action type="Rewrite" url="http://x.com/service1" />
</rule>
<rule name="Reverse Proxy to service2" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{SERVER_PORT}" pattern="5678" />
</conditions>
<action type="Rewrite" url="http://x.com/service2" />
</rule>
</rules>
</rewrite>
更多信息您可以參考此鏈接: Reverse Proxy with URL Rewrite v2 and Application Request Routing 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.