如题, 有一个 url 为 https://xx.net/visu,
nginx 配置为 location / { root /opt/path2/admin/dist; index index.html; }
location ~^/(visu*) { root /opt/path2/visu/dist/; index index.html; }
此时能正常访问, 但是前端路由会跳转成 https://xx.net/visu/inspection 此时上面的 location 会匹配到 localtion / {} 就很奇怪, 我的正则写的不对吗?
1
julyclyde 2023 年 2 月 21 日
你开 debug 级别日志看看
|
2
296727 2023 年 2 月 21 日 要把子类写到父类上边
|
3
Seanfuck 2023 年 2 月 21 日
location ~ ^/visu/ {} 试试
|
4
CopyRight 2023 年 2 月 21 日
alias /opt/path2/visu/dist/;
|