简体   繁体   中英

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.

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?

邮递员形象

When configured to use a custom port, the management server can also be configured with its own SSL using the various management.ssl.* properties. For example, this allows a management server to be available via HTTP while the main application uses 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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM