IIS ARR 多个端口

问题描述

我很难通过具有多个端口的 ARR 在 IIS 中配置余额。 困难在于使用与 80 和 443 不同的门。 在同一台服务器上,我在端口 80、443 和 8080 上有应用程序。我设法让它在端口 80 和 443 上工作。当我添加端口 8080 时,它被重定向到端口 443。

结构如下:

   a  b  c    d
0  1  3  7  3.0
1  2  4  8  3.0
2  3  5  9  3.0

我对 url 重写的规则是:

IP PUBLIC:80   > IIS ARR > Private IP 1:80,PRIVATE IP 2:80

IP PUBLIC:443  > IIS ARR > Private IP 1:443,PRIVATE IP 2:443

IP PUBLIC:8080 > IIS ARR > Private IP 1:8080,PRIVATE IP 2:8080

其他规则:

Name: ARR_Serverfarm_loadbalance

- Match URL    
Requested URL: Matches the Pattern
Using: Wildcard
Pattern: *
MArk: Ignore Case

- Action 
Action type: Route to Server Farm
Scheme: http://
Server farm: serverfarm
Path: /{R:0}
Mark "Stop processing of subquent rules"

感谢您的帮助。

解决方法

我将发布规则,以便更清楚地说明我今天的情况。

                <rule name="ARR_serverfarm_loadbalance" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
                <match url="*" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                <action type="Rewrite" url="http://serverfarm/{R:0}" />
            </rule>
            <rule name="forward proxy" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
                <match url="*" negate="true" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    <add input="{HTTP_HOST}" pattern="*" />
                </conditions>
                <action type="Rewrite" url="http://{C:1}/{R:0}" />
            </rule>
        </globalRules>
,

总而言之,我无法在同一目的地配置端口 80、443 和 8080,最终创建了两个不同的 webfarm,一个在 80 和 443 上,另一个在 8080 和 8443 上。 之后作为最终解决方案,我根据 URL 创建了条件。

示例:

<conditions trackAllCaptures = "true" >
<add input = "{URL}" pattern = "^/app1/( . *)"/> 
</conditions>