一、Vue前端
请求的url为 :
GET /WebServer/home/get-user-info?id=1
二、Spring Boot后端
是一个Get请求的RestFul接口地址,且后端应用的端口为9101
三、Nginx配置(解决跨域问题)
server {
#配置前端监听端口 通过http://localhost:9001/访问前端应用
listen 9001;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#配置前端应用包位置
location / {
root /Users/konsy/Documents/Code/Vue/my-vue-project/dist;
index index.html index.htm;
}
#配置后端反向代理所有WebServer路由的请求都指向http://localhost:9101的后端应用
location /WebServer/ {
proxy_pass http://localhost:9101/;
}
}