Commit cbb2dcb4 by Johannes Edmeier

Add admin.context-path to turbine proxy url

fixes #341
parent 948bfc9b
...@@ -29,6 +29,7 @@ import org.springframework.context.annotation.Conditional; ...@@ -29,6 +29,7 @@ import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import de.codecentric.boot.admin.config.AdminServerProperties;
import de.codecentric.boot.admin.config.AdminServerWebConfiguration; import de.codecentric.boot.admin.config.AdminServerWebConfiguration;
import de.codecentric.boot.admin.config.RevereseZuulProxyConfiguration; import de.codecentric.boot.admin.config.RevereseZuulProxyConfiguration;
import spring.boot.admin.turbine.web.TurbineController; import spring.boot.admin.turbine.web.TurbineController;
...@@ -36,7 +37,7 @@ import spring.boot.admin.turbine.zuul.filters.StaticRouteLocator; ...@@ -36,7 +37,7 @@ import spring.boot.admin.turbine.zuul.filters.StaticRouteLocator;
/** /**
* Configures all necessary components for the Turbine view. * Configures all necessary components for the Turbine view.
* *
* @author Johannes Edmeier * @author Johannes Edmeier
*/ */
@Configuration @Configuration
...@@ -61,9 +62,10 @@ public class TurbineAutoConfiguration { ...@@ -61,9 +62,10 @@ public class TurbineAutoConfiguration {
@Bean @Bean
@Order(100) @Order(100)
public StaticRouteLocator staticRouteLocator() { public StaticRouteLocator staticRouteLocator(AdminServerProperties admin) {
Collection<ZuulRoute> routes = Collections Collection<ZuulRoute> routes = Collections
.singleton(new ZuulRoute("/api/turbine/stream/**", properties.getUrl().toString())); .singleton(new ZuulRoute(admin.getContextPath() + "/api/turbine/stream/**",
properties.getUrl().toString()));
return new StaticRouteLocator(routes, server.getServletPrefix(), zuulProperties); return new StaticRouteLocator(routes, server.getServletPrefix(), zuulProperties);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment