Setup: I have an nginx client which is sending a HTTPS request to an nginx origin server.
I have been doing my research on how the directive 'proxy_ssl_name' can be used to overwrite the SNI. According to the nginx official documentation, the default value used by 'proxy_ssl_name' is $proxy_host.
In my case, the value of $proxy_host is the name of upstream server block ('ups_server'). I can see that 'ups_server' is being sent as the SNI from my client server. I am not able to understand how the origin server is sending the right certificate back to my client when it receives an SNI that doesn't match with any of the supported domain names.
Can someone please help me understand this?