The class EurekaServerAutoConfiguration contains the following code:
if (!requestURI.startsWith(EurekaConstants.DEFAULT_PREFIX + "/v2")
// don't forward static requests (images, js, etc...) to /v2
&& !staticPattern.matcher(requestURI).matches()) {
String updatedPath = EurekaConstants.DEFAULT_PREFIX + "/v2"
+ requestURI.substring(EurekaConstants.DEFAULT_PREFIX.length());
The updatedPath will only be correct if the webapp is deployed in the root context.