不同版本springboot端点开启方法

1.X版本与2.X区别:2.X大部分路径要加“/actuator”

端点列表(注意最后一栏Sensitive为true的端点如果不设置为false将不可访问):

https://docs.spring.io/spring-boot/docs/1.5.3.RELEASE/reference/html/production-ready-endpoints.html#production-ready-endpoints

自定义设置:

endpoints.sensitive=true
endpoints.info.sensitive=false
上面两句的配置意思为将除了info以外的所有端点设置为敏感不可访问(
https://docs.spring.io/spring-boot/docs/1.5.3.RELEASE/reference/html/production-ready-endpoints.html#production-ready-customizing-endpoints


对于health端点如果要看到详细的信息:
需要注意management.security.enabled和endpoints.health.sensitive这两个配置项的配置(都设置为false时,可以不用认证权限直接显示详细信息):
https://docs.spring.io/spring-boot/docs/1.5.3.RELEASE/reference/html/production-ready-monitoring.html#production-ready-health-access-restrictions
posted @ 2019-07-03 09:20  JillWen  阅读(1392)  评论(0编辑  收藏  举报