Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url 针对多个应用程序的IIS重写和反向代理_Url_Iis_Proxy_Url Rewriting_Reverse Proxy - Fatal编程技术网

Url 针对多个应用程序的IIS重写和反向代理

Url 针对多个应用程序的IIS重写和反向代理,url,iis,proxy,url-rewriting,reverse-proxy,Url,Iis,Proxy,Url Rewriting,Reverse Proxy,我有一个IIS 10,上面配置了一个网站。该网站下有多个应用程序。 MyWebsite/app1-MyWebsite/app2-MyWebsite/app3 我有另一台服务器(我们称之为EndServer),在3个不同的端口上托管3个网站 现在,我想做的是使用IIS作为反向代理,将应用程序1重定向并屏蔽到第二服务器中的某个网站,将应用程序2重定向到另一个网站。 最后,用户将进入,他们将在Endserver中看到网站1的内容 注意:对我来说,最终用户看到的URL如 我应该如何编辑以下规则: <

我有一个IIS 10,上面配置了一个网站。该网站下有多个应用程序。 MyWebsite/app1-MyWebsite/app2-MyWebsite/app3

我有另一台服务器(我们称之为EndServer),在3个不同的端口上托管3个网站

现在,我想做的是使用IIS作为反向代理,将应用程序1重定向并屏蔽到第二服务器中的某个网站,将应用程序2重定向到另一个网站。 最后,用户将进入,他们将在Endserver中看到网站1的内容

注意:对我来说,最终用户看到的URL如

我应该如何编辑以下规则:

<rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="(.*)" />
                <action type="Rewrite" url="http://endserver:8052/{R:1}" />
                <conditions trackAllCaptures="true">    
                </conditions>
           </rule>
  </rewrite>

谢谢
A.

根据您的描述,我建议您可以尝试使用下面的url重写规则

<rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions trackAllCaptures="true">
                        <add input="{URL}" pattern="^/app1/(.*)" />
                    </conditions>
                    <action type="Rewrite" url="http://endserver:8052/{C:1}" />
                </rule>
 <rule name="ReverseProxyInboundRule2" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions trackAllCaptures="true">
                        <add input="{URL}" pattern="^/app2/(.*)" />
                    </conditions>
                    <action type="Rewrite" url="http://endserver:8053/{C:1}" />

                </rule>

谢谢你的回答。
我也犯了同样的错误。如下所示,localhost:Port之后的URL中缺少/App1
localhost:8888/assets/styles/Custom.css?m=1549903616.0

我相信问题在于重写响应URL。我不知道谁可以在URL中添加缺少的部分

问候。

你试过什么?