Skip to content

Instantly share code, notes, and snippets.

@BananaAcid
Created June 21, 2019 01:04
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 BananaAcid/e27d0ae5aeb6f9c73f7b61e6daadbfce to your computer and use it in GitHub Desktop.
Save BananaAcid/e27d0ae5aeb6f9c73f7b61e6daadbfce to your computer and use it in GitHub Desktop.
reverse proxy to couchdb on IIS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<!-- disable login ! only locally allowed: http://localhost:5984/_utils/#login -->
<add input="{PATH_INFO}" pattern="^(.*)/_utils/(.*)" negate="true" />
</conditions>
<action type="Rewrite" url="http://localhost:5984/{R:1}" />
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:5984/(.*)" />
<action type="Rewrite" value="http{R:1}://service.saatling.de/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</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