首页 > 解决方案 > Spring boot2 执行器健康状况为 404

问题描述

通过添加 spring-boot-starter-actuator 作为依赖项来使用 Spring Boot 2 执行器。我将服务器端口设置为 9090,将基本上下文设置为 /api。启动spring boot应用程序后,我尝试点击健康网址,例如

local-host:9090/application/health
local-host:9090/actuator/health
local-host:9090/api/application/health
local-host:9090/api/actuator/health

但没有一个成功

我试图把配置像

endpoints.actuator.enabled=true
endpoints.logfile.enabled=true
management.endpoints.web.exposure.include=*

有人可以帮助我理解更好地使用执行器的方法吗?

标签: spring-boot-actuator

解决方案


看起来您没有指定任何前缀。所以你需要直接使用/health

localhost:9090/health

我假设本地主机是这里的错字


推荐阅读