Is there an easy way to add a prefix for all Actuator endpoints?
/env -> /secure/env /health -> /secure/health /info -> /secure/info ...
Jesper's answer is completely correct, but I was looking for an easier way to prefix all endpoints, and this can be done using management.context-path , for example:
management.context-path
management: context-path: /secure -> /secure/env -> /secure/health ...
Set the endpoints.{name}.path in application.properties . For example:
endpoints.{name}.path
application.properties
endpoints.actuator.path=/secure/actuator endpoints.env.path=/secure/env endpoints.health.path=/secure/health endpoints.info.path=/secure/info
To enable endpoint protection, set endpoints.{name}.sensitive to true . For example:
endpoints.{name}.sensitive
true
endpoints.health.sensitive=true
See also Sensitive Endpoint Protection , Drive Security, and HTTP Endpoint Access Restrictions in the Spring Boot reference documentation if you want to protect the actuator endpoints of your application.
See Common Application Properties in the Spring Boot reference documentation for a list of common properties that you can set in application.properties .