Skip to content

Instantly share code, notes, and snippets.

@trnktms
Created October 7, 2020 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trnktms/c7198d2fd6b91719d7b4a32ece4787ee to your computer and use it in GitHub Desktop.
Save trnktms/c7198d2fd6b91719d7b4a32ece4787ee to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="https://cm.green/{R:1}" />
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="IsRedirection">
<match serverVariable="RESPONSE_Location" pattern="^http(s)?://cm.green/(.*)" />
<action type="Rewrite" value="http{R:1}://public.cm.com/{R:2}" />
</rule>
<rule name="ReverseProxyOutboundRule2" preCondition="IsRedirection">
<match serverVariable="RESPONSE_Location" pattern="^http(s)?://cm.blue/(.*)" />
<action type="Rewrite" value="http{R:1}://public.cm.com/{R:2}" />
</rule>
<preConditions>
<preCondition name="IsRedirection">
<add input="{RESPONSE_STATUS}" pattern="3\d\d" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment