Expected behavior

I am using webflux and netty in my spring boot app. I tried with the following line in my application.properties file management.endpoints.web.base-path=/secure

And expecting readiness and liveness probe to be

livenessProbe: httpGet: path: /secure/actuator/health

readinessProbe: httpGet: path: /secure/actuator/health

Actual behavior

But during runtime liveness and readiness path is livenessProbe: httpGet: path: /actuator/health

readinessProbe: httpGet: path: /actuator/health

Steps to reproduce

Add management.endpoints.web.base-path value in configuration file Check readiness and liveness path is having prefix or not

Your Environment

SpringBootVersion="2.4.3" Docker base images: openjdk:15.0.1-jdk-oraclelinux8

Comment From: bclozel

This feature has been introduced in #22906 and has dedicated tests.

Setting management.endpoints.web.base-path=/secure should expose the liveness endpoint under /secure/health/liveness. If this is not the case, could you create a sample project that reproduces the issue so that we can take a look? A zipped application attached to this issue or a github repository would be good.

Thanks!

Comment From: techdeba901

Thanks. Now it is working for me. I have used the following configuration. management.server.servlet.context-path=/secure management.endpoints.web.base-path=/secure

Comment From: techdeba901

Just want to confirm whether adding both the above properties are correct or not.

Comment From: bclozel

You shouldn't need management.server.servlet.context-path, as it's been deprecated - management.endpoints.web.base-path is enough.

Comment From: mbhave

I think this can be closed because it works as expected.