Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
Web Config for Reverse Proxy in IIS
<rule name="Route Requests from localhost api to Remote API url" stopProcessing="true">
<match url="^api/(.*)" />
<add input="{CACHE_URL}" pattern="^(https?)://" />
<action type="Rewrite" url="{R:1}" logRewrittenUrl="true" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
<rule name="Convert remote API response to localhost API" preCondition="ResponseIsHtmlOrJSON">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://*)" />
<action type="Rewrite" value="api/{R:2}" />
<preCondition name="ResponseIsJSON">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^application/json" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.