Skip to content

Instantly share code, notes, and snippets.

@twobob
Created July 8, 2016 01:02
Show Gist options
  • Save twobob/f1f1d8c55d963ff4f3b0c317eebb92ca to your computer and use it in GitHub Desktop.
Save twobob/f1f1d8c55d963ff4f3b0c317eebb92ca to your computer and use it in GitHub Desktop.
ghost URL rewrite web.config for IIS 6.x+ with production profile embedded
configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="index.js" verb="*" modules="iisnode" />
</handlers>
<defaultDocument enabled="true">
<files>
<add value="index.js" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Ghost">
<match url="/*" />
<conditions>
<add input="{PATH_INFO}" pattern=".+\.js\/debug\/?" negate="true" />
</conditions>
<action type="Rewrite" url="index.js" />
</rule>
</rules>
</rewrite>
<iisnode node_env="production" loggingEnabled="true" debuggingEnabled="true" devErrorsEnabled="true" />
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment