I need to setup a server that will server same content over SSL using different domain names. The problem is that I need an ability to add new domain names as easily as possible. Assuming that all domain names are already configured to my server I guess whether it is possible to setup nginx (or maybe another reverse-proxy) in a way so it will listen all requests to a particular IP and after obtaining a HTTPS request try to lookup a certificate for domain that was used to make this request in some folder or DB and serve the request if certificate was found (so we can establish secure connection), or reject the connection if certificate wasn't found.
I'm not sure that it is possible at all or maybe I'm thinking about something reckless but since I wasn't able to find any info on the net I've decided to ask here.
As I understand the most simple solution for this will be to add a separate configuration for each domain that should be supported.