简体   繁体   English

无法在 Spring 引导应用程序中访问新的管理服务器端口

[英]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.

相关问题 Spring 当使用“management.server.port”属性而不是弃用的“management.port”时,启动 MockMvc 测试为执行器端点提供 404 - Spring Boot MockMvc test giving 404 for actuator endpoint when using the "management.server.port" property instead of the deprecated "management.port" Spring 启动应用程序不支持服务器端口的 VM 选项 - Spring boot application not honoring VM options for server port Spring Boot重命名application.properties中的server.port - Spring Boot renaming server.port in application.properties 如何通过Spring Boot应用程序和Spock测试在运行时更改服务器端口 - How to change server port in runtime with a spring boot application and spock testing Spring Boot更改服务器端口 - Spring boot change server port 带有Spring Boot REST应用程序的OAuth2 - 无法使用令牌访问资源 - OAuth2 with Spring Boot REST application - cannot access resource with token 无法访问Spring Boot and Jersey应用程序中的某些控制器 - Cannot access some controllers in a Spring Boot and Jersey application 在tomcat中部署后无法访问spring boot应用程序 - Cannot access spring boot application after deployment in tomcat Docker 中的 Postgres 服务器无法连接到 spring 启动应用程序 - Postgres Server in Docker cannot connect to spring boot application 设置管理端口时无法使用Spring Boot的执行器 - Spring boot's actuator unavailable when set management port
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM