azure static web apps部署静态网页,需要设置伪静态规则

建站 · 09-15 · 133 人浏览
location / {
   try_files $uri $uri/ /index.html;
}

这个规则,使用azure部署时,需要在运行目录添加routes.json路由配置文件。内容如下

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