不同版本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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM