mardi 18 mai 2021

How do I create a proxy_pass junction by header value in NGINX?

I would like to do something like this:

location / {

    if($http_x_my_header == 'some-value') {
        proxy_pass "https://a/";
    }
    # else
    proxy_pass "https://b/";

}

Because I know that using "IF" in NGINX can be kind of problematic: How would I solve this following "best practices"?

Aucun commentaire:

Enregistrer un commentaire