【问题标题】:IIS ARR Multiple portsIIS ARR 多个端口
【发布时间】:2021-05-27 17:01:10
【问题描述】:

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

结构如下:

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

我对 url 重写的规则是:

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"

其他规则:

Name: Forward proxy
- Match URL
Requested URL: Does not match the Pattern
Using: Wildcards
Pattern: *
Mark: Ignore case


- Conditions
logical grouping: Match All
{HTTP_HOST} Match the Pattern * 
    
- Action
Action type: Rewrite    
Rewrite URL: http://{C:1}/{R:0}    
Mark Append query string.

感谢您的帮助。

【问题讨论】:

  • 您可以使用Fiddler 找出导致8080端口重定向到443端口的原因。
  • 嗨..你能解释一下如何在提琴手中找到重定向吗?我下载了它并安装在我的电脑上。我打开浏览器,访问 url domain.com:8080 并被定向到端口 80 应用程序。在 Fiddler 中,我看到端口 8080 上的连接,我点击它,在它显示数据的一侧,但没有重定向信息。
  • 早上好。我在 ARR 服务器上打开了跟踪,但它不会产生错误。我又复习了一遍,所以我相信这个问题没有错误。我正在尝试使用端口 8080 上的源和端口 8080 上的目标创建规则。如果您有任何其他问题,请告诉我。
  • 您可以查看生成的xml文件,它会显示将端口8080重定向到端口443的位置。

标签: iis iis-7 iis-7.5 iis-8


【解决方案1】:

我将发布规则以更清楚地说明我今天的内容。

                <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>

【讨论】:

    【解决方案2】:

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

    例子:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-21
      • 1970-01-01
      • 2014-09-01
      • 2015-05-21
      • 1970-01-01
      • 2016-06-21
      • 2017-09-21
      • 1970-01-01
      相关资源
      最近更新 更多