From 6a0737dacfd26f25510503dc70be49a1ecd0d28b Mon Sep 17 00:00:00 2001 From: Johannes Stelzer Date: Thu, 2 Apr 2015 20:33:05 +0200 Subject: [PATCH] Example of static, loadbalanced Zuul configuration It took me quite a bit, to figure out how to configure Zuul to use a loadbalanced route without Eureka. I hope this short explicit example will clarify it for other people. --- .../src/main/asciidoc/spring-cloud-netflix.adoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/src/main/asciidoc/spring-cloud-netflix.adoc b/docs/src/main/asciidoc/spring-cloud-netflix.adoc index 74f96ab9..7ff80e7a 100644 --- a/docs/src/main/asciidoc/spring-cloud-netflix.adoc +++ b/docs/src/main/asciidoc/spring-cloud-netflix.adoc @@ -820,6 +820,23 @@ The location of the backend can be specified as either a "serviceId" url: http://example.com/users_service ---- +These simple url-routes doesn't get executed as HystrixCommand nor can you loadbalance multiple url with Ribbon. +To achieve this specify a service-route and configure a Ribbon client for the serviceId, e.g. + +.application.yml +[source,yaml] +---- + zuul: + routes: + users: + path: /myusers/** + serviceId: users + + users: + ribbon: + listOfServers: example.com,google.com +---- + To add a prefix to all mappings, set `zuul.prefix` to a value, such as `/api`. The proxy prefix is stripped from the request before the request is forwarded by default (switch this behaviour off with