springboot+tomcat+vue+nginx 前后端分离配置
location / {root /www/server/tomcat8/webapps/eduadmin;
index index.html index.htm;
try_files $uri $uri/ /index.html;#解决登录之后刷新404
}
location /api {
proxy_pass http://localhost:8000/education;#前端能够访问到后端
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
# 解决session共享问题 同步/education 和 /api
proxy_cookie_path /education /api;
# root html;
# index index.html index.htm;
}
以上是 springboot+tomcat+vue+nginx 前后端分离配置 的全部内容, 来源链接: utcz.com/z/379135.html