在做一个 CAS 系统,业务系统发现用户没有登录后引导跳转到 CAS。
业务系统1域名:benchmark-1.xxx.com
业务系统2域名:benchmark-2.xxx.com
CAS域名:cas.xxx.com
nginx 配置如下:
server {
listen 80;
server_name cas.xxx.com;
location / {
proxy_pass http://localhost:8090;
}
}
server {
listen 80;
server_name benchmark-1.xxx.com;
location / {
proxy_pass http://localhost:8095;
}
}
server {
listen 80;
server_name benchmark-2.xxx.com;
location / {
proxy_pass http://localhost:8096;
}
}
String requestUrl = request.getRequestURL().toString();
当页面跳转后观察到浏览器地址栏的主机变成了 localhost:8095
http://cas.xxx.com/auth/login?redirectUrl=http://localhost:8095/user/get
这样我的 CAS 就没有办法重定向回业务系统。我现在定位是 Nginx 配置 proxy_pass 的问题,但是不知道怎么改,请各位不吝赐教。