深夜放毒~
umi本身通过nginx或node服务器启动,前置负载均衡nginx新建location反向代理umi所在服务器。
如前置nginx路径:http://localhost:8081/aaa
上游umi服务:http://localhost:8080
要求正常访问。
此时umi需进行以下配置。
config/config.js中找到export default ,增加配置:
export default {
history: 'hash',
publicPath:"./"
}
配置完成后,访问http://localhost:8081/aaa即正常。
网友评论