I need to implement my spring boot + cloud gateway app to serve as proxy to a few rules involving multiple sites such as as follows:
usecase 1: http://gateway/admin/** <-> http://site1/** (an admin site)
usecase 2: http://gateway/rest/** <-> http://site1/rest/** (a REST API)
usecase 3: http://gateway/<everything else>/** -> http://site2/**
I have so far experimenting on netflix-zuul as described in spring.io tutorials like this:
zuul.routes.admin.path=/admin/**
zuul.routes.admin.url=http://site1
zuul.routes.rest.path=/rest/**
zuul.routes.rest.url=http://site1/rest
ribbon.eureka.enabled=false
Simple 1-to-1 mapping works, e.g., http://gateway/rest/foo <-> http://site1/rest/foo. This might be enough only for usecase #2.
What I'm not sure about is how to proxy the admin site in the same host using a prefix ("admin") as in usecase #1 (i.e., internal links has to be translated also)?
Also, later on, I need to catch everything else in usecase #3 and forward them properly to a second site "site2".
Is Zuul the right tool for this? Kindly show me to the right direction. TIA!