Routing at the load balancer?

We’re about to undertake some significant architecture overhauls which will include spinning up new containers running web processes. One of these new containers is going to handle a subset of URLs that are currently being handled by an existing container.

I’d like to redirect traffic from URLs matching a specific pattern to the new container as quickly as possible. For example, URLs matching* would hit a different container.

Do you have any recommendations for accomplishing this? I assume the load balancer is the proper place to configure this? Is that configuration something I have access to?


Hey @hylas,

We don’t support injecting custom routing rules at the load balancer level. This
wouldn’t work on Aptible due to how load balancing is set up:

  • We use AWS ELB for load balancing at the TCP level and therefore cannot
    route based on URLs. The ELB also only sees encrypted traffic anyway if
    you’re enforcing SSL

  • An instance-local reverse proxy does SSL termination and routes traffic to
    app containers on the same instance (at which point it’s too late to route
    traffic to another instance).

So there are two options here:

  1. You could have your app proxy traffic to a different container. We have
    some customers that do this by deploying Nginx as an app on Aptible, although
    this adds another layer of indirection to your infrastructure.

  2. Our recommended approach: use a different domain, and route that to a
    different endpoint in Aptible. You can always have your app itself redirect (not
    proxy) the old URLs to the new domain if you’re concerned about references to
    those URLs laying around.

Hope this helps!