How to exclude or ignore special routes or routes from zuul routing

Is it possible to exclude paths or mappings from Zuul routing?

The goal is to

  • All requests / contracts / ** are sent to contract.example.com
  • All requests to / audit / ** are routed to audit.example.com
  • All requests / heartbeat / ** or / sso / ** are submitted directly from zuul.
  • All other requests (/ **) are sent to html.example.com

I have a configuration like this:

zuul: routes: contract: path: /contracts/** url: http://contracts.example.com:8080/api audit: path: /audits/** url: http://audit.example.com:8080 html: path: /** url: http://html.example.com:80 

Now the question is how to determine that / heartbeat and / sso are not routed to html.example.com zuul?

I am using Spring Boot and its auto configuration.

+6
source share
2 answers

There is a configuration property called ignored-patterns. Using this, you can define connectors to exclude routes from routing.

 zuul: ignoredPatterns: - /heartbeat/** - /sso/** routes: contract: path: /contracts/** url: http://contracts.example.com:8080/api audit: path: /audits/** url: http://audit.example.com:8080 html: path: /** url: http://html.example.com:80 
+10
source

As of Brixton.SR6 properties must be different in the application.yml file. It should be defined as follows:

 zuul: ignoredPatterns: /heartbeat/**, /sso/** routes: contract: path: /contracts/** url: http://contracts.example.com:8080/api 
+3
source

All Articles