版本: druid-spring-boot-starter: 1.1.6场景: 两台云服务器,一台有外网访问地址作为网关; 一台内网服务器作为应用的宿主机,由网关路由到内网。问题: 当通过网关访问druid监控url时,被重定向到内网IP真实地址,导致不能访问监控页。
1yjd4xko1#
遇到同样的问题,一个网关服务,一个模块服务,这个服务部署在 docker 中,网关访问这个服务时,直接定向到 docker 内部网络地址,导致外网无法访问
fdbelqdn2#
同样的问题,没有人处理吗?
login.html 静态资源可以正常访问。
login.html
index.html 响应 302 重定向到Docker Container IP地址 Location: http://10.10.3.200:9030/druid/login.html是不是应该根据 Referer 或者更复杂网络的 X-Forwarded-* 头信息来构建重定向地址呢?其中 8000 端口是 Spring Cloud Gateway , /stats 是某一个微服务,不向外映射端口
index.html
302
Location: http://10.10.3.200:9030/druid/login.html
Referer
X-Forwarded-*
8000
Spring Cloud Gateway
/stats
Request URL: http://192.168.9.192:8000/stats/druid/index.htmlRequest Method: GETStatus Code: 302 FoundRemote Address: 127.0.0.1:54321Referrer Policy: strict-origin-when-cross-originConnection: keep-aliveDate: Wed, 16 Dec 2020 09:26:06 GMTLocation: http://10.10.3.200:9030/druid/login.htmlTransfer-Encoding: chunkedAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9Cache-Control: no-cacheConnection: keep-aliveCookie: ...Host: 192.168.90.192:9000Pragma: no-cacheReferer: http://192.168.9.192:8000/stats/druid/login.htmlUpgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.99 Safari/537.36
2条答案
按热度按时间1yjd4xko1#
遇到同样的问题,一个网关服务,一个模块服务,这个服务部署在 docker 中,网关访问这个服务时,直接定向到 docker 内部网络地址,导致外网无法访问
fdbelqdn2#
同样的问题,没有人处理吗?
login.html
静态资源可以正常访问。index.html
响应302
重定向到Docker Container IP地址Location: http://10.10.3.200:9030/druid/login.html
是不是应该根据
Referer
或者更复杂网络的X-Forwarded-*
头信息来构建重定向地址呢?其中
8000
端口是Spring Cloud Gateway
,/stats
是某一个微服务,不向外映射端口Request URL: http://192.168.9.192:8000/stats/druid/index.html
Request Method: GET
Status Code: 302 Found
Remote Address: 127.0.0.1:54321
Referrer Policy: strict-origin-when-cross-origin
Connection: keep-alive
Date: Wed, 16 Dec 2020 09:26:06 GMT
Location: http://10.10.3.200:9030/druid/login.html
Transfer-Encoding: chunked
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Cookie: ...
Host: 192.168.90.192:9000
Pragma: no-cache
Referer: http://192.168.9.192:8000/stats/druid/login.html
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.99 Safari/537.36