<outboundRules> <rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding"> <match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" /> <action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" /> </rule> <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Img, Input, Link, Script" pattern="^http(s)?://InternalContentServerIP/folder/(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true" /> <action type="Rewrite" value="https://aaa.com/bbb/{R:2}" /> </rule> <rule name="RewriteResponseLocation" stopProcessing="true"> <match serverVariable="RESPONSE_Location" pattern="^http(s)?://InternalContentServerIP/folder/(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true" /> <action type="Rewrite" value="https://aaa.com/bbb/{R:2}" /> </rule> <rule name="RewriteRelativePath1-1" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Img, Input, Link, Script" pattern="^/bbb/(.*)" negate="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true" /> <action type="Rewrite" value="/bbb/{R:1}" /> </rule> <rule name="RewriteRelativePath1-2" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://(.*)" negate="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true" /> <action type="Rewrite" value="{R:0}" /> </rule> <rule name="RewriteRelativePath1-3" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^mailto:(.*)" negate="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true" /> <action type="Rewrite" value="{R:0}" /> </rule> <rule name="RewriteRelativePath1-4" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^javascript:(.*)" negate="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true" /> <action type="Rewrite" value="{R:0}" /> </rule> <rule name="RewriteRelativePath1" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^/(.*)" negate="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true" /> <action type="Rewrite" value="{R:1}" /> </rule> <rule name="RewriteRelativePath2-2" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^bbb/(.*)" negate="false" /> <conditions logicalGrouping="MatchAny" trackAllCaptures="true" /> <action type="Rewrite" value="{R:1}" /> </rule> <rule name="RewriteRelativePath2-1" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^(.*)" negate="false" /> <conditions logicalGrouping="MatchAny" trackAllCaptures="true"> <add input="{REQUEST_URI}" pattern="bbb/" /> </conditions> <action type="Rewrite" value="./{R:1}" /> </rule> <rule name="RewriteRelativePath2" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^(.*)" negate="false" /> <conditions logicalGrouping="MatchAny" trackAllCaptures="true"> <add input="{REQUEST_URI}" pattern="bbb/(.*)" /> </conditions> <action type="Rewrite" value="/bbb/{R:1}" /> </rule> <rule name="RewriteRelativePath3" preCondition="ResponseIsHtml1" enabled="true" stopProcessing="true"> <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="(.*)" negate="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> <add input="{REQUEST_FILENAME}" pattern="bbb/(.*)" negate="true" /> </conditions> <action type="Rewrite" value="/bbb/{R:1}" /> </rule> <preConditions> <preCondition name="ResponseIsHtml1" logicalGrouping="MatchAny"> <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/plain" /> </preCondition> <preCondition name="NeedsRestoringAcceptEncoding"> <add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" /> </preCondition> </preConditions>
</outboundRules>
|