发布于2025-05-03 阅读(0)
扫一扫,手机访问
代码:
location /demo {
root E:/;
index index.html index.htm;
}
这样配置的有一个问题,只能 http://localhost/demo/来访问。
如果想访问里面的其它界面如 http://localhost/demo/page1的话,就报404找不到页面。
可是开发的时候,确实没有问题,可以进行访问的,于就想难道必须得用node来项目吗?不会吧,也许是自己不会配置所致。
解决方法
终于找到办法了,在其它人的nginx.config里发现多加了一行东西。
location /demo {
root E:/;
#加上了这个,就可以在url后面直接加路由上配置path了。
try_files $uri /demo/index.html;
index index.html index.htm;
}
上一篇:《地下城与勇士》起源转职推荐
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店