Load balancer - traffic distribution between containers according to URL.
Hi!
How can I route traffic based on URL?
For example:
https://<my_domain>/ - goes to one container
https://<my_domain>/<path1> - goes to a second container
https://<my_domain>/<path2> - goes to another container
Thanks!
Hey Ruslan,
You can do this by creating load balancer routes and utilizing path matches plus redirects.
Environment -> Services -> Manage (next to Load Balancer) -> Controllers -> Port 443 -> Config -> Routers.
When you create your routes, remember that order matters -- first match wins. The most specific path will need to be at the start.
I believe Chris or Alex is working on a guide for this in our documentation.
Hi Jake!
Am I correct in understanding that when assigning a container in the LB, the LINKED record in DNS does not matter? Is it possible to use any logical operators, such as &&, ||, or !, in URL definitions? Does the URL need to be exact, or will the rule apply to all nested URLs as well?