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

怎样将前端客户端远程部署到nginx上,我远程部署时无法请求到后端的数据 #233

Open
coder-xbai opened this issue Jan 13, 2023 · 7 comments

Comments

@coder-xbai
Copy link

No description provided.

@coder-xbai
Copy link
Author

准确来说远程部署后可以访问后端的端口,但是静态资源404

@Yin-Hongwei
Copy link
Owner

准确来说远程部署后可以访问后端的端口,但是静态资源404

music-client/vue.config.js和music-manage/vue.config.js里的域名改成你部署后后端的域名

@coder-xbai
Copy link
Author

coder-xbai commented Jan 14, 2023

image
image
U_BEM RSMIT@VRD~ `V_5

,后端的songlist能够请求到数据,但是静态就不行,已经在客户端更改了自己的ip了,我在浏览器http://远程服务器ip:8888/img/songPic/tubiao.jpg, 这样在浏览器直接请求静态资源是404 ,按理说静态资源是可以直接请求到的

@Yin-Hongwei
Copy link
Owner

music-server/src/main/java/com/example/yin/constant/Constants.java 这里对比一下资源的路径

@coder-xbai
Copy link
Author

coder-xbai commented Jan 14, 2023

image
整个项目我在本地能正常运行,但是远程部署后,出现上述,是这里的PROJECT_PATH 是代表的music-server,还是music-website-master

image

@Yin-Hongwei
Copy link
Owner

都不是,整体代表资源的绝对路径

@coder-xbai
Copy link
Author

将constant里面的路径换成了resource下的static目录下打包部署到nginx上还是访问不到静态文件,而songlist接口可以访问到数据
image

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