简体   繁体   中英

How IIS 80 port webstie set one sub-app only intranet and other internet?

eg,my iis folder directory structure like:

IIS
 |-default app (80 port)
   |- Aapp
   |- Bapp
   |- Capp

I can set all 80 port app have internet premission,but i have trouble when I'd like to set Aapp only intranet premission and other app Bapp,Capp have internet premission.

expected:

  • user on internet link https://mycompany.com/Aapp get 404 status code
  • user on intranet link https://192.168.1.1/Aapp get 200 status code
  • user on internet link https://mycompany.com/Bapp get 200 status code

If your intranet IP segement looks like 192.168.xx Then you could set the rule like this to exclude intranet IP address. In this case, all IP doesn't match your intranet net will be blocked by Aapp.

<rule name="rewrite  rule1" stopProcessing="true">
    <match url="Aapp" />
    <conditions>
        <add input="{REMOTE_ADDR}" pattern="192\.168\.[0-9]+\.[0-9]+" negate="true" />
    </conditions>
    <action type="CustomResponse" statusCode="404" subStatusCode="0" statusReason="Internet access not allowed" statusDescription="Not found" />
</rule>

If 404 response is not necessarily.Then you can set domain and IP restriction rule for each application.

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh831785(v=ws.11)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM