1

My Setup

  • Azure AppService Linux Plan
  • VueJs app that I'm deploying to it
  • Using Azure DevOps pipeline with "Azure AppService Deploy" task and Runtime Stack set to "1.0 (STATICSITE|1.0)"

Problem: I need to set the 404 page to the index.html so Vue can take over the routing. Currently if I deep link to a route in Vue I get this: 404 Not Found nginx/1.17.9

Windows AppService plans support Default Documents but Linux doesn't (you can't combine Windows and Linux on a given AppServicePlan) Static Websites has a routes.json approach for this (I don't want to use static websites, which is different from "static websites runtime in AppService")

Ideas on the easiest/lightest way to handle this?

AndyV
  • 388
  • 1
  • 6
  • 14

1 Answers1

1

Go to Configuration ->StartupCommand: pm2 serve /home/site/wwwroot --no-daemon --spa on portal.

For more details, Pls refer my answer in related post.

Successful deployment still leads to default page

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • Thanks for the tip. How supported/brittle do you think this is? Their documentation doesn't seem to call this out anywhere that I could find. – AndyV Feb 12 '21 at 14:19
  • @AndyV https://stackoverflow.com/questions/61377340/react-router-direct-links-not-working-on-azure-web-app-linux – Jason Pan Feb 16 '21 at 01:17
  • This doesn't seem to work for me ... at least not with a runtime of `1.0 (STATICSITE|1.0)`. Maybe this only works for NodeJS-Runtimes? – nyn3x Sep 08 '21 at 19:01