Carlos Alberto
Carlos Alberto

Reputation: 8605

Spring Eureka server does not find context-path in client url

When a client application is registered into Spring Eureka server the client id appears at dashboard, but the link url only contains the hostname and port without the context-path of client.

If I create the Spring Boot client application without setting a context-path, I mean default root context, Eureka server can access all actuators available in there.

Is there any way to inform Eureka server about it? I tried to set health and info properties, but it did not work.

Upvotes: 3

Views: 7793

Answers (2)

Minh Trần
Minh Trần

Reputation: 62

application.yml

server:
  servlet:
    context-path: /your-path

Upvotes: 0

nicholas.hauschild
nicholas.hauschild

Reputation: 42834

If your Eureka client is setup via Spring's @EnableEurekaClient, then the client will default the health check and status check to /health and /info respectively. (These paths may be the default values beyond the Spring @EnableEurekaClient setup, but I am unfamiliar with those at this point in time).

You can override these defaults by setting the following properties:

eureka.instance.statusPageUrlPath

eureka.instance.healthCheckUrlPath

The Spring Cloud Documentation contains this information, plus much more.

Upvotes: 6

Related Questions