Eureka-server配置servlet.context-path后导致Eureka-client注册到server问题

在springboot项目里配置了servlet.context-path(应用上下文路径),也称之为项目路径,该配置让项目URL后增加配置的值。
如果在Eureka-server中配置该值,当然也会改变Eureka-server的URL。
但如果Eureka-client需要注册到Eureka-server的话,需要修改eureka.client.service-url.defaultZone的值。例如:http://localhost:10086/eureka 原先的注册地址需要在 '/eureka'前加上配置的servlet.context-path值 => http://localhost:10086/auto/eureka。这样才能完成注册。
Peace

猜你喜欢

转载自www.cnblogs.com/coding-jc/p/12076550.html