Skip to content

Instantly share code, notes, and snippets.

@troydai
Last active April 13, 2017 21:37
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 troydai/720278dc077f6e4d19c152dd2461d503 to your computer and use it in GitHub Desktop.
Save troydai/720278dc077f6e4d19c152dd2461d503 to your computer and use it in GitHub Desktop.
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<rewrite>
<rules>
<!--<rule name="ForceSSL" stopProcessing="true">-->
<!-- <match url="^(.*)" />-->
<!-- <conditions>-->
<!-- <add input="{HTTPS}" pattern="^off$" ignoreCase="true" />-->
<!-- </conditions>-->
<!-- <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />-->
<!--</rule>-->
<rule name="Proxy" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://157.55.140.53:8123/{R:1}" />
<serverVariables>
<set name="HTTP_X_UNPROXIED_URL" value="http://157.55.140.53:8123/{R:1}" />
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_X_ORIGINAL_HOST" value="{HTTP_HOST}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="ChangeReferencesToOriginalUrl" patternSyntax="ExactMatch">
<match filterByTags="None" pattern="http://157.55.140.53:8123" />
<action type="Rewrite" value="https://{HTTP_X_ORIGINAL_HOST}/{R:1}" />
</rule>
<preConditions>
<preCondition name="CheckContentType">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^(text/html|text/plain|text/xml|application/rss\+xml)" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<proxy xdt:Transform="InsertIfMissing" enabled="true" preserveHostHeader="false" reverseRewriteHostInResponseHeaders="false" />
<rewrite>
<allowedServerVariables>
<add name="HTTP_X_ORIGINAL_HOST" xdt:Transform="Insert" />
<add name="HTTP_X_UNPROXIED_URL" xdt:Transform="Insert" />
<add name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" xdt:Transform="Insert" />
<add name="HTTP_ACCEPT_ENCODING" xdt:Transform="Insert" />
</allowedServerVariables>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment