0

在您可以使用相同的动态端口Spring boot 2.3.8-RELEASE公开管理执行器HTTP和服务器。HTTPS当我升级到Spring boot 2.5.3时,管理执行器暴露在上面HTTPS。Consul 健康检查失败,因为它使用HTTP而不是HTTPS在主服务器和管理的同一动态端口上。

那么Spring boot 2.5.3,如何配置管理执行器端点以使用HTTP并具有与服务器相同的动态端口?

有什么帮助或想法吗?

此配置禁用执行器端点 HTTP 或 HTTPS

server:
  port: 0 # dynamic port
  ssl.key-store: classpath:keystore.p12
truststore:
  location: classpath:truststore.jks

management:
  ssl.enable: false  
  endpoints:
    web:
      exposure:
        include: health,info,env,configprops
    endpoint:
      health:
        show-details: always

此配置通过 HTTPS 而不是 HTTP 启用执行器

server:
  port: 0 # dynamic port
  ssl.key-store: classpath:keystore.p12
truststore:
  location: classpath:truststore.jks

management:
  server.ssl.enabled: false # actuator still exposed over HTTPs 
  endpoints:
    web:
      exposure:
        include: health,info,env,configprops
    endpoint:
      health:
        show-details: always
4

0 回答 0