Azure AppService Linux网站上的默认文档(自定义404) [英] Default Documents (custom 404) on Azure AppService Linux website

查看:60
本文介绍了Azure AppService Linux网站上的默认文档(自定义404)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的设置

  • Azure AppService Linux计划
  • 我正在为其部署的
  • VueJs应用
  • 将Azure DevOps管道与"Azure AppService Deploy"一起使用;任务和运行时堆栈设置为"1.0(STATICSITE | 1.0)"

问题:我需要将404页面设置为index.html,以便Vue可以接管路由.目前,如果我深入链接到Vue中的路线,则会得到以下信息:找不到404 nginx/1.17.9

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计划支持默认文档,但Linux不支持(您不能在给定的AppServicePlan上组合Windows和Linux)静态网站对此有一种route.json方法(我不想使用静态网站,这与"AppService中的静态网站运行时"不同)

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?

推荐答案

转到配置-> StartupCommand : pm2 serve/home/site/wwwroot--no-daemon --spa 在门户网站上.

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

有关更多详细信息,请在相关文章中引用我的答案.

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

成功部署仍然会导致默认页面

这篇关于Azure AppService Linux网站上的默认文档(自定义404)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆