如题, 有一个 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-02-21 14:08:25 +08:00
你开 debug 级别日志看看
|
2
296727 2023-02-21 14:09:32 +08:00 1
要把子类写到父类上边
|
3
Seanfuck 2023-02-21 14:15:40 +08:00
location ~ ^/visu/ {} 试试
|
4
CopyRight 2023-02-21 14:54:41 +08:00
alias /opt/path2/visu/dist/;
|