Eureka 无法识别像“/info”和“/health”这样的 HTTPS 端点,并且在启用 HTTPS 后始终指向 HTTP 端点。如何在 Eureka 启用 HTTPS 微服务 url 注册?
最佳答案
您必须明确定义这些 URL,因为 Eureka 始终在内部指向 HTTP。阅读Here有关更多信息。
您可以将以下内容添加到微服务中的 yaml 文件中。
eureka:
instance:
nonSecurePortEnabled: false
securePortEnabled: true
statusPageUrl: 'https://${eureka.instance.hostName}:${server.port}/info'
healthCheckUrl: 'https://${eureka.instance.hostName}:${server.port}/health'
homePageUrl: 'https://${eureka.instance.hostName}:${server.port}/'
这里 “eureka.instance.hostName” 和 “server.port” 值将从环境中获取。
关于spring-boot - Eureka注册Https微服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35617996/