Skip to content

Instantly share code, notes, and snippets.

@bmingles
Last active November 28, 2021 21:35
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 bmingles/76124b97bb5d980a748b6f165eb4920f to your computer and use it in GitHub Desktop.
Save bmingles/76124b97bb5d980a748b6f165eb4920f to your computer and use it in GitHub Desktop.
Azure App Service Config
# Configuration -> General Settings -> Startup Command
pm2 serve /home/site/wwwroot/ --no-daemon --spa
<?xml version="1.0"?>
<configuration>
<!--TBD: Not sure if this is actually needed-->
<!-- <location path="index.html">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="no-cache" />
</customHeaders>
</httpProtocol>
</system.webServer>
</location> -->
<system.webServer>
<rewrite>
<rules>
<rule name="React 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" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment