Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

二次开发后打包部署在ngnix访问404 #1064

Open
songshenma opened this issue Jun 18, 2020 · 1 comment
Open

二次开发后打包部署在ngnix访问404 #1064

songshenma opened this issue Jun 18, 2020 · 1 comment

Comments

@songshenma
Copy link

描述:二次开发了代码,同时包含mock(主要是queryUserInfo、 loginUser、queryRouteList这些系统相关请求)和真实API请求(自己业务相关)。已知umi build之后mock无法使用,目前在build之后,设置了ngnix(7000端口)中通过跨域请求umi-serve开启的mock服务(7001端口提供,并且通过postman测试成功)来访问系统相关数据,来模拟请求后端数据。但部署在ngnix后登录的页面都是404。
相关截图如下:
image

我的ngnix配置如下:
image
现在怀疑几个地方出问题了:
1.使用的是umi的动态路由配置,没有静态路由文件?
2. .umirc.js中publicPath:'./'和 history:'hash'已设置,是否有问题?
请帮忙解决下,很困扰。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants