jeecgboot / JeecgBoot

🔥「企业级低代码平台」前后端分离架构SpringBoot 2.x/3.x,SpringCloud,Ant Design&Vue3,Mybatis,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。

Home Page:http://www.jeecg.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

部署问题

a1069120636 opened this issue · comments

版本号:3.6.3
分支: springboot3
前端版本: vue3版
问题描述:

在windos上部署后,按照官方文档改了nginx的配置,但是前端访问后端提示404

截图&代码:

WeChate076616f0d04dbff999a7baef9b5c438
这个好像才是正常路径
WeChatf6c40d3e7c662aca49b996996333f53d
nginx配置
server {
listen 80;
server_name 192.168.2.193;
#前端打的dist资源存放目录
root /D:/www/project;

location / {
     # 用于配合 browserHistory使用
	 try_files $uri $uri/ /index.html;
}

location  /jeecgboot/ {
	#后台接口地址(我们部署去掉了/jeecg-boot项目名,如果你有请加上)
	proxy_pass         http://127.0.0.1:8080/;
	proxy_redirect off;
	#真实IP获取
	proxy_set_header  Host             $host;
	proxy_set_header  X-Real-IP        $remote_addr;
	set $my_proxy_add_x_forwarded_for $proxy_add_x_forwarded_for;
	if ($proxy_add_x_forwarded_for ~* "127.0.0.1"){
	   set $my_proxy_add_x_forwarded_for $remote_addr;
	}
	proxy_set_header   X-Forwarded-For $my_proxy_add_x_forwarded_for;
}

error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   html;
}

}

好像就是location ./jeecgboot没有正确跳转到ip:8080 这是vue配置文件
a4e3dd5006b86b64cfd1f1e116755239

解决了 chatgpt永远的神
location /jeecgboot/ {
proxy_pass http://127.0.0.1:8080/jeecg-boot/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}