簡體   English   中英

僅針對特定端口的IIS7 URL重寫

[英]IIS7 url rewrite for a specific port only

我有一個Web服務器,我只想將端口8800重定向到其他服務器。 我希望端口80和443保留在同一服務器上。 我嘗試在IIS7中使用ARP和反向代理。 我創建了使用以下參數的反向代理規則。

這是我的入站網址mydomain.com:8800

我想將其路由到myotherdomain.com

當我進行設置時,它會出錯,並且沒有人可以在任何端口上訪問該網站。

謝謝。

首先將mydomain.com:8800綁定到網站,然后將配置文件放置到Web根文件名中,web.config的內容為...

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="nexus respotory Redirect" stopProcessing="true">
                    <match url=".*"/>
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="^mydomain\.com$"/>

                    </conditions>
                    <action type="Redirect" url="http://myotherdomain/{R:0}" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM