【问题标题】:Pivotal Cloud foundry - Spring Boot Actuator not working with Pivotal Apps ManagerPivotal Cloud Foundry - Spring Boot Actuator 无法与 Pivotal Apps Manager 一起使用
【发布时间】:2017-02-10 00:50:30
【问题描述】:
我目前正在将 spring boot 1.5.1 应用程序部署到关键的云代工厂。应用程序管理器正在显示 Spring 图标,但我无法配置日志级别或查看任何设置。我收到浏览器“混合内容异常”。应用程序管理器正在尝试通过 http 而不是 https 访问 /cloudfoundryapplication/info,并且浏览器阻止了该请求。是否有强制应用管理器仅使用 https 的设置?
【问题讨论】:
标签:
spring-boot-actuator
cloud-foundry
【解决方案1】:
我们的团队遇到了类似的问题。我们认为这与应用程序管理器无关,而是与我们的应用程序的行为方式有关。
在我们的例子中,我们有一个错误的配置,导致在调用 httpRequest.getScheme() 时 URLS 被构建为 http。
server.tomcat.internal-proxies: <ips other then your proxy>
在我们的案例中,通过将其设置为定义为 here 的默认值来更正此属性,让 getScheme 以 https 的形式返回,并且当调用 /cloudfoundryapplication/info 时,该方案被构建为 https。
我们的一位同事提出的另一个建议也解决了这个问题,但不能解决根本原因 - 使用 ForwardedHeaderFilter 将您的应用程序(最高优先级)放在前面 - 这会导致 X-FORWARDED-* 标头可用在您的 httpServletResquest 中描述为here