请教一条nginx规则:无条件跳转去 /index.html

58次阅读

共计 251 个字符,预计需要花费 1 分钟才能阅读完成。

一个域名 https://xxx.com 如何设置 nginx 的 conf 文件,实现:
不管你访问任何路径,比如
https://xxx.com/a.html
https://xxx.com/b/c.html
都跳转去
http://xxx.com/index.html
多谢各位大佬

把 404 定义到 index 就行了
error_page 404 /index.html;location / {
try_files ” /index.html =404;
} 复制代码

正文完
 0