
原本业务的页面时 http://www.abc.com/index.html 是一个纯静态服务,目录下也有 index.html 这个文件
但是后面将此服务改成了服务端渲染,服务端的第一个路由是 /
请问,如何通过 nginx 配置将原本的 http://www.abc.com/index.html 全部转发到 http://www.abc.com/
1 rrfeng 2020-04-28 14:40:58 +08:00 rewrite /index.html / break; |
2 cloverzrg2 2020-04-28 14:41:51 +08:00 server { ... location /index.html { return 301 https://$server_name/; } } |
3 cloverzrg2 2020-04-28 14:42:54 +08:00 ``` server { ... location /index.html { return 302 https://$server_name/; } } ``` |
4 lvming6816077 OP 十分感谢! |