方案1:在網關的配置文件里增加以下配置 management:endpoints:web:exposure:include: []enabled-by-default: falseendpoint:health:show-details: ALWAYS
方案二:直接在nginx配置攔截actuator相關接口
location /actuator {
? ? ? ? return 403;
? ? }
? ? location /api/actuator {
? ? ? ? return 403;
? ? }
? ? location /actuator/ {
? ? ? ? return 403;
? ? }
? ? location /api/actuator/ {
? ? ? ? return 403;
? ? }