spring boot连接eureka的时候,statusPageUrlPath、healthCheckUrlPath的配置

---
spring:
  profiles: same.port

server:
  port: ${SERVER_PORT:8089}
  context-path: ${SERVER_CONTEXTPATH:}

management:
  context-path: ${MANAGEMENT_CONTEXTPATH:}
  port: ${MANAGEMENT_PORT:${server.port:${SERVER_PORT:8080}}}

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
  instance:
    preferIpAddress: false
    statusPageUrlPath: ${server.context-path:${SERVER_CONTEXTPATH:}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.info.path:/info}
    healthCheckUrlPath: ${server.context-path:${SERVER_CONTEXTPATH:}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.health.path:/health}
    metadata-map:
      management.context-path: ${server.context-path:${SERVER_CONTEXTPATH:}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}
      management.port: ${management.port:${MANAGEMENT_PORT:${server.port:${SERVER_PORT:8080}}}}

---
spring:
  profiles: seperated.mgmt.port

server:
  port: ${SERVER_PORT:8087}
  context-path: ${SERVER_CONTEXTPATH:}

management:
  context-path: ${MANAGEMENT_CONTEXTPATH:}
  port: ${MANAGEMENT_PORT:8088}

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
  instance:
    preferIpAddress: false
#    Don't use bellow config for seperated management port
#    statusPageUrlPath: ${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.info.path:/info}
#    healthCheckUrlPath: ${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.health.path:/health}

    status-page-url: http://${eureka.instance.hostname:localhost}:${management.port:${MANAGEMENT_PORT:8088}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.info.path:/info}
    health-check-url: http://${eureka.instance.hostname:localhost}:${management.port:${MANAGEMENT_PORT:8088}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.health.path:/health}

    metadata-map:
      management.context-path: ${management.context-path:${MANAGEMENT_CONTEXTPATH:}}
      management.port: ${management.port:${MANAGEMENT_PORT:${server.port:${SERVER_PORT:8088}}}}

你可能感兴趣的:(java)