简体   繁体   English

仅针对特定端口的IIS7 URL重写

[英]IIS7 url rewrite for a specific port only

i have a webserver that I want to redirect only port 8800 to a different server. 我有一个Web服务器,我只想将端口8800重定向到其他服务器。 I want port 80 and 443 to be left on the same server. 我希望端口80和443保留在同一服务器上。 I tried using ARP and reverse proxy in IIS7. 我尝试在IIS7中使用ARP和反向代理。 i created a reverse proxy rule that used the following parameters. 我创建了使用以下参数的反向代理规则。

this is my inbound url mydomain.com:8800 这是我的入站网址mydomain.com:8800

i want to route it to myotherdomain.com 我想将其路由到myotherdomain.com

Wheni set this up it errors out and no one can access the website on any port. 当我进行设置时,它会出错,并且没有人可以在任何端口上访问该网站。

Thanks. 谢谢。

first bind mydomain.com:8800 to a website then put config file to web root file name web.config content is ... 首先将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