1 Actuator配置
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
gateway:
enabled: true
health:
show-details: always
endpoint信息具体可以查阅Springboot Actuator官方接口文档
2 安全性
2.1 作为探测接口
配置management.endpoints.web.exposure.include: info, 此时只用于进行内部服务探测。
2.2 内部监控
在微服务对外开放的接口或Gateway网关前面加上Nginx,配置/actuator直接返回404。
location /actuator {
return 404;
}