Nginx upstream server certificate verification

Sergey Kandaurov pluknet at nginx.com
Mon Apr 10 17:16:54 UTC 2017


> On 6 Apr 2017, at 21:46, shivramg94 <nginx-forum at forum.nginx.org> wrote:
> 
> Thank Sergey, for you response. 
> 
> I have one more question. If I have multiple upstream server host names in
> the upstream server block, then how can I specify the specific upstream
> server host name to which the request is being proxied, in the
> proxy_ssl_name directive?
> 
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273295,273462#msg-273462

You could try to construct proxy_ssl_name based on upstream address, e.g.:

    map $upstream_addr $name {
        ~\Q192.0.2.1:8000\E$ first;
        ~\Q192.0.2.2:8000\E$ second;
    }

    proxy_ssl_name $name;

Note well that $upstream_addr may contain multiple addresses, use it
with a special care.  See for details: http://nginx.org/r/$upstream_addr

-- 
Sergey Kandaurov



More information about the nginx mailing list