[英]Cannot Access new Management Server Port in Spring Boot Application
In my Spring Boot Application I changed the default management server port in order to expose it on different port through HTTP. My main app works on HTTPS with SSL key and I don't want to expose it there.在我的 Spring 引导应用程序中,我更改了默认管理服务器端口,以便通过 HTTP 在不同端口上公开它。我的主要应用程序在 HTTPS 上运行,密钥为 SSL,我不想在那里公开它。
server.ssl.enabled=true
server.ssl.key-store-type=PKCS12
server.ssl.key-store=classpath:local-ssl.p12
server.ssl.key-store-password=<password>
server.ssl.key-alias=local_ssl
server.port=8443
management.server.ssl.enabled=false
management.server.port=8081
management.endpoints.web.exposure.include=health,info,prometheus
However when I am trying to access the http://localhost:8081/actuator/prometheus, I am receiving the following picture from Postman. How can I access my endpoints through the new port?但是,当我尝试访问 http://localhost:8081/actuator/prometheus 时,我从 Postman 收到了以下图片。如何通过新端口访问我的端点?
When configured to use a custom port, the management server can also be configured with its own SSL using the various management.ssl.*
properties.当配置为使用自定义端口时,管理服务器也可以使用各种
management.ssl.*
属性配置自己的 SSL。 For example, this allows a management server to be available via HTTP while the main application uses HTTPS:例如,这允许通过 HTTP 访问管理服务器,而主应用程序使用 HTTPS:
server.port=8443
server.ssl.enabled=true
server.ssl.key-store=classpath:store.jks
server.ssl.key-password=secret
management.port=8080
management.ssl.enabled=false
Alternatively, both the main server and the management server can use SSL but with different key stores:或者,主服务器和管理服务器都可以使用 SSL 但密钥存储不同:
server.port=8443
server.ssl.enabled=true
server.ssl.key-store=classpath:main.jks
server.ssl.key-password=secret
management.port=8080
management.ssl.enabled=true
management.ssl.key-store=classpath:management.jks
management.ssl.key-password=secret
for reference look here https://docs.spring.io/spring-boot/docs/1.5.4.RELEASE/reference/html/production-ready-monitoring.html参考看这里https://docs.spring.io/spring-boot/docs/1.5.4.RELEASE/reference/html/production-ready-monitoring.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.