Search code examples
spring-bootspring-cloud-consul

Consul is throwing error of spring boot health Url (401)


I have configured consul with my spring boot application, I have basic Auth to access the url.

If I hit localhost:8081/health it is asking for basic authentication and status is UP

but in consul UI it is throwing an error

HTTP GET http://192.168.1.155:8081/health: 401  Output: HTTP Status 401 - Full authentication is required to access this resource

How can I provide this authentication in consul.


Solution

  • I have disabled the security health in spring boot application and it's working fine because to check health we don't need any security