Since revision 7b270c4b, Zuul add support of `X-Forwarded-Prefix` for route with `stripPrefix=true`. However it supposes that Zuul context-path is equals to `/`. By using a custom context-path on Zuul we can expect that `zuul.add-proxy-headers=true` will compute a prefix regarding that context-path. Indeed with following architecture: - Zuul with context-path equals to `/foo` - A random service (*bar-service*) without context-path Zuul configurations: ``` zuul: add-proxy-headers: true routes: bar-service: /bar/** ``` We expect that *bar-service* when targeting `http://blabla.com/foo/bar/1` will produce endpoint url equals to `http://blabla.com/foo/bar` and not only `http://blabla.com/bar` (that will not be resolvable). Furthermore context-path influence not only `stripPrefix=true` routes because with following configuration ``` zuul: add-proxy-headers: true routes: bar-service: path: /bar/** strip-prefix: false ``` We expect that *bar-service* when targeting `http://blabla.com/foo/bar/1` will also prodcues endpoint url equals to `http://blabla.com/foo/bar`... --- Moreover since *Spring 4.3* and new [`ForwardedHeaderFilter`](http://docs.spring.io/spring-framework/docs/4.3.0.BUILD-SNAPSHOT/javadoc-api/org/springframework/web/filter/ForwardedHeaderFilter.html) to handle `X-Forwarded-*` headers, when filter catches `X-Forwarded-Prefix` header it will override request context-path by `X-Forwarded-Prefix` header value and then **removes headers from request**. Thus the fact to support context-path will allow to use that filter with Zuul! --- Attention there is only one edge case, when `X-Forwarded-Prefix` header is present as same as custom `context-path`! In that case context-path will be ignored in favor to `X-Forwarded-Prefix` as same does `ForwardedHeaderFilter`
Name |
Last commit
|
Last update |
---|---|---|
.mvn | Loading commit data... | |
docs | Loading commit data... | |
eclipse | Loading commit data... | |
scripts | Loading commit data... | |
spring-cloud-netflix-core | Loading commit data... | |
spring-cloud-netflix-dependencies | Loading commit data... | |
spring-cloud-netflix-eureka-client | Loading commit data... | |
spring-cloud-netflix-eureka-server | Loading commit data... | |
spring-cloud-netflix-hystrix-amqp | Loading commit data... | |
spring-cloud-netflix-hystrix-dashboard | Loading commit data... | |
spring-cloud-netflix-hystrix-stream | Loading commit data... | |
spring-cloud-netflix-sidecar | Loading commit data... | |
spring-cloud-netflix-spectator | Loading commit data... | |
spring-cloud-netflix-turbine | Loading commit data... | |
spring-cloud-netflix-turbine-stream | Loading commit data... | |
spring-cloud-starter-archaius | Loading commit data... | |
spring-cloud-starter-atlas | Loading commit data... | |
spring-cloud-starter-eureka | Loading commit data... | |
spring-cloud-starter-eureka-server | Loading commit data... | |
spring-cloud-starter-feign | Loading commit data... | |
spring-cloud-starter-hystrix | Loading commit data... | |
spring-cloud-starter-hystrix-dashboard | Loading commit data... | |
spring-cloud-starter-ribbon | Loading commit data... | |
spring-cloud-starter-spectator | Loading commit data... | |
spring-cloud-starter-turbine | Loading commit data... | |
spring-cloud-starter-turbine-amqp | Loading commit data... | |
spring-cloud-starter-turbine-stream | Loading commit data... | |
spring-cloud-starter-zuul | Loading commit data... | |
.gitignore | Loading commit data... | |
.settings.xml | Loading commit data... | |
.travis.yml | Loading commit data... | |
Guardfile | Loading commit data... | |
LICENSE.txt | Loading commit data... | |
README.adoc | Loading commit data... | |
asciidoctor.css | Loading commit data... | |
mvnw | Loading commit data... | |
mvnw.cmd | Loading commit data... | |
pom.xml | Loading commit data... |