docsify部署在二级目录下的url进行301重定向(nginx环境)
2022-02-21
docsify通常部署在网站二级目录,如/docs等。

如果访问时,页面url的#号类似www.xxxxx.com/docs#/test,docs后面没有带斜杠,可以使用301重定向:
location = /docs {
return 301 https://$server_name/docs/;
}
重启nginx,这是访问url:www.xxxxx.com/docs/#/test,更加友好。
(版权归cpury.com所有,转载请注明出处。)