Cloud Foundry Support
Spring Boot 的执行器模块包括在部署到兼容的 Cloud Foundry 实例时激活的附加支持。“/cloudfoundryapplication
”路径为所有“@Endpoint
”Bean 提供了备用的安全路由。
Spring Boot’s actuator module includes additional support that is activated when you deploy to a compatible Cloud Foundry instance.
The /cloudfoundryapplication
path provides an alternative secured route to all @Endpoint
beans.
扩展的支持允许 Cloud Foundry 管理 UI(例如用来查看已部署应用程序的 Web 应用程序)可以通过 Spring Boot 执行器信息进行扩充。例如,应用程序状态页可以包括完整运行状况信息,而不仅仅是典型的““running””或““stopped””状态。
The extended support lets Cloud Foundry management UIs (such as the web application that you can use to view deployed applications) be augmented with Spring Boot actuator information. For example, an application status page can include full health information instead of the typical “running” or “stopped” status.
普通用户无法直接访问“ |
The |
Disabling Extended Cloud Foundry Actuator Support
如果您想完全禁用“/cloudfoundryapplication
”端点,可以将以下设置添加到“application.properties
”文件:
If you want to fully disable the /cloudfoundryapplication
endpoints, you can add the following setting to your application.properties
file:
management: cloudfoundry: enabled: false
Cloud Foundry Self-signed Certificates
默认情况下,“/cloudfoundryapplication
”端点的安全验证会对各种 Cloud Foundry 服务进行 SSL 调用。如果您的 Cloud Foundry UAA 或 Cloud Controller 服务使用自签名证书,需要设置以下属性:
By default, the security verification for /cloudfoundryapplication
endpoints makes SSL calls to various Cloud Foundry services.
If your Cloud Foundry UAA or Cloud Controller services use self-signed certificates, you need to set the following property:
management: cloudfoundry: skip-ssl-validation: true
Custom Context Path
如果服务器的上下文路径已配置为除“/
”以外的任何内容,Cloud Foundry 端点将不可用于应用程序的根目录。例如,如果“server.servlet.context-path=/app
”,则 Cloud Foundry 端点可用于“/app/cloudfoundryapplication/*
”。
If the server’s context-path has been configured to anything other than /
, the Cloud Foundry endpoints are not available at the root of the application.
For example, if server.servlet.context-path=/app
, Cloud Foundry endpoints are available at /app/cloudfoundryapplication/*
.
如果您希望无论服务器的上下文路径如何,Cloud Foundry 端点始终可用于“/cloudfoundryapplication/*
”,需要在应用程序中显式配置这一点。配置因所使用的 Web 服务器而异。对于 Tomcat,可以添加以下配置:
If you expect the Cloud Foundry endpoints to always be available at /cloudfoundryapplication/*
, regardless of the server’s context-path, you need to explicitly configure that in your application.
The configuration differs, depending on the web server in use.
For Tomcat, you can add the following configuration:
如果您正在使用基于 Webflux 的应用程序,可以使用以下配置:
If you’re using a Webflux based application, you can use the following configuration: