Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

How can I restrict access to a certain URL when using AAR?

$
0
0

So, if I'm using IIS as a reverse proxy (AAR and rewrite) to an internal application, but I also want to restrict access to a sub page, how would I do this?

Example:

internal webserver localhost:PORT/site/ rewrites to mydomain/site

(That’s working fine) current web.config looks like this:

===================

<rewrite>
<rules>
<clear />
<rule name="ReverseProxyInboundRulesonarr" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
<action type="Rewrite" url="http://192.168.1.20:38084/sonarr/{R:1}" />
</rule>
</rules>

<outboundRules>
<clear />
<rule name="Restore Encoding" preCondition="Restore HTTP_ACCEPT_ENCODING}" enabled="true">
<match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.+)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
<action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
</rule>

<rule name="ReverseProxyOutboundsonarr" preCondition="ResponseIsHtml1" patternSyntax="ECMAScript">
<match filterByTags="A, Area, Base, Form, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://192.168.1.20:38084/sonarr/(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
<action type="Rewrite" value="http{R:1}://domain.com/sonarr/{R:2}" />
</rule>

<preConditions>
<remove name="Restore HTTP_ACCEPT_ENCODING}" />
<remove name="ResponselsHTML1" />
<remove name="ResponseIsHtml1" />
<remove name="NeedsRestoringAcceptEncoding" />
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
<preCondition name="Restore HTTP_ACCEPT_ENCODING}">
<add input="{RESPONSE_CONTENT_TYPE}" pattern=".+" />
</preCondition>
</preConditions>
</outboundRules>

</rewrite>

=============

However, I want to restrict (or redirect back to the root page) access to

mydomain/site/settings

The internal webserver doesn’t have this function, so I’m wondering if I can do this at the IIS level?

Is this possible?

THX


Viewing all articles
Browse latest Browse all 2482

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>