Welcome! Log In Create A New Profile

Advanced

Is it possible to reference a named variable in the ssl_certificate directive?

Posted by swinster 
Is it possible to reference a named variable in the ssl_certificate directive?
December 10, 2016 03:25PM
Hi,

I'm looking to create a single simple server block that can handle multiple domains. Creating a RegEx match in the server block is straightforward enough, however, I can't seem to reference the named variable in the `ssl_certificate` and `ssl_certificate_key` directives, which would be required to reference different certificates.

The server block is something like:

server {
listen 443 ssl;
server_name ~^meet.(?<domain>.+)\.(com|co\.uk)$;

ssl_certificate ssl/$domain/cert.pem;
ssl_certificate_key ssl/$domain/certkey.pem;
...

}

I can refer to the $domain variable later in location blocks, but not in the ssl directives.

Is there any way to achieve something like this?

Cheers
Re: Is it possible to reference a named variable in the ssl_certificate directive?
January 30, 2017 06:07AM
Hi All,

Just in case this was missed, does anyone no if this is at all possible?
Re: Is it possible to reference a named variable in the ssl_certificate directive?
January 30, 2017 11:20AM
https://www.google.nl/#q=lua+dynamic+ssl+certificate

ea:
https://litespeed.io/dynamic-tls-certificates-with-openresty-and-ssl_certificate_by_lua/

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Is it possible to reference a named variable in the ssl_certificate directive?
January 30, 2017 12:20PM
Thanks @itpp2012, unfortunately, that site (litespeed.io) has an expired cert. :(
Re: Is it possible to reference a named variable in the ssl_certificate directive?
January 30, 2017 12:23PM
Just create a temporary exception.

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready