方案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;
     }
