Nginx Routing to Upstream Based on Cookie or Header Value

79 views Asked by At

This one is bugging me and it should work but I must be missing a nuance somewhere:

#== UPSTREAMS ==
upstream server_vip {
    server superduper.com:443;
}

upstream server_alt_vip {
    server superduper2.com:443;
} 

    map $cookie_route_parallel $pool { 
        default "server_vip";
        value2 "server_alt_vip";
        value1 "server_vip";
    }

        location /directory {
            proxy_pass https://$pool/directory;

So it appears to be routing to the default fine with server_vip, but it is not picking up the cookie when it has value2 and fowarding to server_alt_vip.

0

There are 0 answers