比如我项目的主页是:www.xxx.com/dashboard/
Nginx 配置项:
location /dashboard {
root /opt/app/;
try_files $uri $uri/ /dashboard/index.html;
index index.html index.htm;
}
在 History 模式下,首页是没有问题,但是如果多两级 path 就不行了。
比如:www.xxx.com/dashboard/welcome/index
浏览器会请求: /dashboard/welcome/ 路径下的 js/css 等资源,造成无法正常访问。
请问有什么解决办法吗?