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!

Ruslan Moskalenko...

    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.

    Jake Warner...

    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?

    Ruslan Moskalenko...

    Hi, I navigated to Environment -> Services -> Manage (next to Load Balancer) -> Controllers -> Port 443 -> Config -> Routers, but I don’t see any options for configuring URL-based routing there. Deployment has been completed with two servers and three containers, each running two instances for high availability. The container pointed to by the LINKED record is working.

    Ruslan Moskalenko...

    No LINKED Records. Containers are only resolvable via HTTP/S over the public internet when they have a LINKED record.

    Ruslan Moskalenko...

    Hi Ruslan,

    Correct, Linked records help teach the load balancer how traffic is routed.

    On the routers, do you see a field named "Path Match" ?

    Jake Warner...

    Yes, I have three containers, each with two instances: home, awards, and youtube.

    I ended up creating three LINKED records, one for each, as otherwise, it resulted in an error.

    Each container has its own path:

    home - / awards - /awards youtube - /youtube I configured the Load Balancer settings under the Config section for each container according to its path and for port 443.

    However, it’s unclear what is meant by "Match Internal Port(s)" since I already defined port mapping during the container deployment.

    Also, access to the containers (except for home) via their network addresses is not working.

    Ruslan Moskalenko...

    Hey Ruslan,

    Our team recently updated the documentation for the items you had questions about:

    • https://cycle.io/docs/platform/native-load-balancer
    • https://cycle.io/docs/portal/configuring-v1#advanced

    Please let me know if these don't help.

    Jake Warner...

    Hi Jake!

    I’ve reviewed the documentation, but it’s still unclear how the LINKED record should look if I need to route traffic between three containers.

    Should I specify one container out of the three in the LINKED record? Or should I create three separate LINKED records, one for each container?

    Ruslan Moskalenko...

    Hi Ruslan,

    Are the three containers at different domains, or are they using the same domain? Are they using different ports?

    Jake Warner...

    Hi Jake!

    All containers are on the same domain but on different paths. All three use ports 443 and 80.

    Ruslan Moskalenko...

    Normally this would be configured with the LB Routers using a path match. There's currently a race condition that exists when path match is used (it's a relatively new feature).

    As a temporary measure, I'd suggest using nginx service as the destination for the linked record for all 3 domains, then have nginx to the path matching and forwarding for the requests.

    Jake Warner...

    Hey Ruslan,

    I just wanted to update this to bring it in line with what is now supported on the platform.

    Path matching can now be implemented per router.

    To implement this just create linked records that all point to the same container and then create routers, each of which will have a path match regex in the path match section of the controller.

    Then the appropriate container for each router should be set to include and the 1 or more containers that should be excluded, should be set to exclude.

    If you'd like to be even more granular you can include the incoming domain as part of the router specificity.

    For each inbound request that reaches a given controller, routers are evaluated in order and the first router that finds a match will consume the request. Make sure to order the routers using the icon at the end of the row (or in the json if you're doing things in stacks or programmatically).

    Christopher Aubuchon...

Join the conversation

Sign in with your Cycle account to reply to this thread.

v2026.06.23.01 · © 2026 Petrichor Holdings, Inc.
Cookies

Cookies Preferences

We run basic, anonymous analytics by default to measure site traffic. By clicking "Accept," you allow additional cookies for advanced app improvements and tailored advertising. Choose what you share by clicking "Customize."