【发布时间】:2022-01-25 13:33:26
【问题描述】:
我正在努力寻找有关如何在 Angular 和 Nginx 中设置路由以支持以下逻辑的任何好的文档或指南:
Route File Status
example.com -> index.html 200 OK
example.com/path -> index.html 200 OK
example.com/not-found -> index.html 404 NOT FOUND
example.com/another-not-found -> index.html 404 NOT FOUND
要点:
- 刷新页面应该得到相同的结果
- 转到不存在的路径不应重定向,它应提供 404 状态代码并显示 404 页面。
有没有办法做到这一点?任何帮助将不胜感激。
【问题讨论】:
标签: angular nginx url routes http-status-code-404