To support this feature you will need to intercept the TLS request and check the presence of SNI field.
Openresty which is a distro of nginx supports LUA. LUA code can be used to intercept the client Hello and check if SNI/servername is present.
You can check it here : https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/ssl/clienthello.md