Kavya Kotacherry
Kavya Kotacherry

Reputation: 45

How to specify multiple server names in proxy_ssl_name in nginx reverse proxy configuration

My nginx upstream has multiple servers, eg:

upstream backend {
        server backend1.example.com:12345;
        server backend2.example.com:12345;
        server anotherbackend.com:12345;
   }
server {
        listen     12345;
        proxy_pass backend;
        proxy_ssl  on;
        proxy_ssl_verify on;
        proxy_ssl_name  ??

The proxied HTTPS server can provide certificates with any of the subject names backend1.example.com or anotherbackend.com. Is it possible to configure the proxy_ssl_name to verify certificate with any of these subject names? Or do all the backend servers have to present the same certificate?

Upvotes: 2

Views: 6061

Answers (1)

Quantim
Quantim

Reputation: 291

If you have corresponding certificate for every server, you can use

proxy_ssl_name $proxy_host;

Or can create one certificate with all Subjec Alt Name inside and distribute it to all backends

Upvotes: 2

Related Questions