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