You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, a reverse proxy config looks like this:
reverse_proxy
to https://server101.local:8443 https://server102.local:8443
}
It would be nice if the upstreams had a name like server101 and server102. A few reasons:
a) Land on a specific upstream by adding GET param lb=server101
b) Land on a specific upstream by setting header lb: server101
c) Land on a specific upstream by parsing cookie, e.g., JSESSIONID=uuid.server101
Here is a sample config from another load-balancer that shows the idea:
upstream backend {
server backend1.example.com route=a;
server backend2.example.com route=b;
sticky route $route_cookie $route_uri;
}
The text was updated successfully, but these errors were encountered:
I would suggest using a map directive in conjunction with a placeholder for the upstream address; that way you can map an arbitrary string to a backend address, then use that. 👍
And if you need to load balance to two backends you can map to multiple placeholders and then specify both in the reverse proxy config.
Ultimately, the goal here for me is to support a new lb_policy that routes based on the application's cookie instead of Caddy's inserted cookie.
Tomcat is a popular Java application server and often sends cookies like JSESSIONID=xxxxx-yyyyy-zzzzzzz.appserver1094. It would be easier to write a new lb_policy if there was a name for each upstream. I suppose I could just check for the presence of a map in a custom lb_policy, but it seemed like a common enough use case supported by other loadbalancers that I should write it up.
Can you just use the map directive with the {cookie.JSESSIONID} placeholder? Then you could set an upstream that way. I guess it's not clear to me why that isn't a sufficient solution.
Currently, a reverse proxy config looks like this:
It would be nice if the upstreams had a name like
server101
andserver102
. A few reasons:a) Land on a specific upstream by adding GET param lb=server101
b) Land on a specific upstream by setting header lb: server101
c) Land on a specific upstream by parsing cookie, e.g., JSESSIONID=uuid.server101
Here is a sample config from another load-balancer that shows the idea:
The text was updated successfully, but these errors were encountered: