java - Nginx 如何配置所有 URL 都指向一个HTML
PHPz
PHPz 2017-04-18 09:31:27
0
2
570

必须在不使用重定向的情况下

  • 例如:https://www.xxx.com/asda/asdas/asda 返回 index.html

  • 例如:https://www.xxx.com/ss/ss/assd 返回 index.html

但是排除以 https://www.xxx.com/api/v1的请求

PHPz
PHPz

学习是最好的投资!

Antworte allen(2)
黄舟

location / {

root     “你的页面路径”;
index.html;

}
location api/v1 {

这里配置你之前的就可以了

}

左手右手慢动作

不使用rewrite好像不行吧。
404文件指定为index.html?

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage