Wood Chen

Configure Rewrite Rules for Static Sites on Azure Static Web Apps

0 comments71 views23 words

This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文

location / {
   try_files $uri $uri/ /index.html;
}

To apply this rule when deploying on azure, add a routes.json routing configuration file to the runtime directory with the following content:

{
  "routes": [
    {
      "route": "/*",
      "serve": "/index.html",
      "statusCode": 200
    }
  ]
}

Last updated 2024-01-14

Related posts

Comments 0