-
-
Save dphoebus/b8376a0d9dfc6268dc658e0b135bc2c7 to your computer and use it in GitHub Desktop.
ASP.NET web.config configuration for Single Page Application (AngularJS) running on IIS with OwinHttpHandler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<system.web> | |
<compilation debug="true" targetFramework="4.5" /> | |
<httpRuntime targetFramework="4.5" /> | |
</system.web> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="AngularJS Routes" stopProcessing="true"> | |
<match url=".*" /> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> | |
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /> | |
<add input="{REQUEST_URI}" pattern="^/(scripts)" negate="true" /> | |
<add input="{REQUEST_URI}" pattern="^/(styles)" negate="true" /> | |
<add input="{REQUEST_URI}" pattern="^/(maps)" negate="true" /> | |
<add input="{REQUEST_URI}" pattern="^/(assets)" negate="true" /> | |
</conditions> | |
<action type="Rewrite" url="/" /> | |
</rule> | |
</rules> | |
</rewrite> | |
<handlers> | |
<remove name="StaticFile"/> | |
<remove name="ExtensionlessUrlHandler-Integrated-4.0" /> | |
<remove name="OPTIONSVerbHandler" /> | |
<remove name="TRACEVerbHandler" /> | |
<add name="Owin" verb="" path="*" type="Microsoft.Owin.Host.SystemWeb.OwinHttpHandler, Microsoft.Owin.Host.SystemWeb"/> | |
</handlers> | |
<modules runAllManagedModulesForAllRequests="true" /> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment