Java Spring ZuulProxy,带RefreshableRouteLocator的反向代理
我需要反向代理程序,然后我找到了zuulproxy。我想够了。 当我将任何地址写入url时,如“localhost:8000”,我的规则如下:Java Spring ZuulProxy,带RefreshableRouteLocator的反向代理,java,spring,dynamic,reverse-proxy,netflix-zuul,Java,Spring,Dynamic,Reverse Proxy,Netflix Zuul,我需要反向代理程序,然后我找到了zuulproxy。我想够了。 当我将任何地址写入url时,如“localhost:8000”,我的规则如下: ZuulProperties.ZuulRoute route1 = new ZuulProperties.ZuulRoute("/**", "http://google.com"); 那很好。 但是我不需要它。如何为/使用多个URL参数编写路由? 有可能像“localhost:8000/google”、“l
ZuulProperties.ZuulRoute route1 =
new ZuulProperties.ZuulRoute("/**", "http://google.com");
那很好。
但是我不需要它。如何为/使用多个URL参数编写路由?
有可能像“localhost:8000/google”、“localhost:8000/yandex”这样吗
我试过了,但没有正常工作:
ZuulProperties.ZuulRoute route1 =
new ZuulProperties.ZuulRoute("/google/**","http://google.com");
额外的行数
route1.setStripPrefix(Boolean.FALSE);
Set<String> sensitiveHeaderSet = Sets.newHashSet();
route1.setSensitiveHeaders(sensitiveHeaderSet);
route1.setCustomSensitiveHeaders(true);
我想我会出卖这些知识
@Bean
public RouteLocator routeLocator() {
RouteLocator routeLocator = new RouteLocator("/", this.zuulProperties);
return routeLocator;
}