how to configure dynamic Virtual host with dynamic SSL configuration in nginx? how to configure dynamic Virtual host with dynamic SSL configuration in nginx? nginx nginx

how to configure dynamic Virtual host with dynamic SSL configuration in nginx?


Unfortunately, it's not possible because nginx needs to load the whole SSL server configuration at start time.

Source: https://t37.net/the-good-the-bad-and-the-ugly-of-virtual-hosting-with-nginx.html


Since Nginx version 1.15.9 variables are supported in "ssl_certificate" and "ssl_certificate_key" directives.


You can load them dynamically by using lua.You need to figure out how you want to map and fetch them though.

Here is an example of loading them from a database:https://github.com/Vestorly/nginx-dynamic-ssl/blob/master/conf/nginx.conf