Pattern route to different backend domains based on incoming domain?

We’ve been using pushpin for years and are extremely happy with it!

What would be the best way to get pushpin to route to different preview deployment domains based on either the incoming domain name, origin header or even a path segment? I know you could always just append to the rules file for each deployment domain. But the routes are pretty much pattern-based, like e.g.:

{branch_name} {branch_name},ssl,over_http

Is there some way to specify such a dynamic routing rule?

Unfortunately, such dynamic routing is not possible. You’d need to add each route explicitly.

Alternatively, you could put a proxy between pushpin and the backends that is capable of this kind of routing, if there is such a thing.

We could consider adding a feature in pushpin to help with this kind of routing, but we’d want to keep it simple as pushpin is not intended to be a substitute for a full load balancer. One idea that comes to mind is to let a proxy between clients and pushpin perform the backend selection logic, maybe by setting a header. So you’d still need a separate proxy, but it is common to have a proxy/LB in front of pushpin so maybe you already have one that could be leveraged for something like this.