nginx try_files出现错误向大家求教

头像穷的只剩作业 · 提问于2021.11.12浏览量:568

location / {
root /webapps/build/;
index index.html index.htm;
try_files $uri /index.html;
}

nginx配置完了

发现刷新https://XXX.com/machine/general,
资源请求的路径都不对了。

应该是:
https://XXX.com/static/js/13.7e356b15.chunk.js
实际是:
https://XXX.com/machine/static/js/13.7e356b15.chunk.js

怎么会这样呢,我应该怎么改呢?

全部回答 · 1
最新最热
  • 用户头像
    雨润静荷2021.11.12 15:37

    webpack中把相对路径./改为绝对路径/应该就可以了

热门问题