gpt4 book ai didi

azure - 限制对暂存和开发插槽的访问

转载 作者:行者123 更新时间:2023-12-02 01:13:47 27 4
gpt4 key购买 nike

我需要限制对我网站的暂存和开发位置的访问。因此,我在 web.config 中添加了此规则(如所述 here )

<rule name="Block unauthorized IP to staging/dev sites" stopProcessing="true">

<match url=".*" />

<conditions>
<!-- Enter your staging site host name here as the pattern-->
<add input="{HTTP_HOST}" pattern="myapp\-dev.azurewebsites.net" />
<add input="{HTTP_HOST}" pattern="myapp\-staging.azurewebsites.net" />

<!-- Add the white listed IP addresses with a new condition as seen below -->
<!-- <add input="{REMOTE_ADDR}" pattern="123\.123\.123\.2" negate="true"/> -->
</conditions>

<action type="Redirect" redirectType="Permanent" url="www.google.fr"/>
</rule>

我需要限制访问

  1. http://myapp-dev.azurewebsites.net
  2. http://myapp-staging.azurewebsites.net

它仍然可以访问。所以我需要知道如何解决这个问题?

谢谢

最佳答案

默认情况是匹配所有条件,但您只需匹配一个条件,因为它是开发站点或登台站点。您需要添加逻辑分组=“MatchAny”,还需要将http://添加到www.google.fr。以下规则应该有效:

<rule name="Block unauthorized IP to staging/dev sites" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="myapp\-dev.azurewebsites.net" />
<add input="{HTTP_HOST}" pattern="myapp\-staging.azurewebsites.net" />
<!-- Enter your staging site host name here as the pattern-->
<!-- Add the white listed IP addresses with a new condition as seen below -->
<!-- <add input="{REMOTE_ADDR}" pattern="123\.123\.123\.2" negate="true"/> -->
</conditions>

<action type="Redirect" redirectType="Permanent" url="http://www.google.fr" />
</rule>

关于azure - 限制对暂存和开发插槽的访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43638172/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com