Skip to content

Instantly share code, notes, and snippets.

@aih
Created September 15, 2015 21:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aih/8f2b8d76b44d8836bd77 to your computer and use it in GitHub Desktop.
Save aih/8f2b8d76b44d8836bd77 to your computer and use it in GitHub Desktop.
A sample web.config file with URL rewrite rules for Elasticsearch on IIS (Windows)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<remove name="ReverseProxyInboundRule1" />
<rule name="ReverseProxyInboundRule1" stopProcessing="false">
<match url="search/_search(.*)" />
<conditions />
<serverVariables />
<action type="Rewrite" url="http://localhost:9200/_search{R:1}" />
</rule>
<rule name="ReverseProxyInboundRule2" patternSyntax="ExactMatch" stopProcessing="true">
<match url="search/_cluster/health" />
<action type="Rewrite" url="http://localhost:9200/_cluster/health" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment