Transparent url handling

I have a requirement where i have multiple internal services,

  1. service1:9000
  2. service2:9001
  3. service3:9003

Each service have it's own dynamic path e.g

How do get a route based on the path,
http://service/path1 => maps to http://service1:9000 + the dynamic urls
http://service/path2 => maps to http://service1:9001 + the dynamic urls



How an URL is composed:

  • scheme: http
  • host: service1
  • port: 9000
  • path: hub
  • query: next=%2F

To define a rule, you can use several matchers:

  • Host(`...`) to manage the host
  • Path(`...`) or PathPrefix(`...`) to manage the path
  • Query(`...`) to manage query parameters

Thank you for the reply.

In case of http://service1:9000 the anything after port is dynamic and i want this to be mapped to
http://service/home/ redirects to http://service1:9000/hub?open=%2F it should return http://service/home/hub?open=%2F

the paths are dynamic here

Is middlewares/replacepathregex equivalent to rewrite