Using $host variable in ssl_certificate path

dimitre nginx-forum at
Wed Oct 20 16:00:36 UTC 2021

hello, I'm trying to use the variable $host in this entry: 

ssl_certificate /etc/letsencrypt/live/$host/fullchain.pem; 
ssl_certificate_key /etc/letsencrypt/live/$host/privkey.pem; 

to potentially make one entry that fits multiple domains, but it is not
I think the variable $host is not parsed in this specific directive 

nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/$host/fullchain.pem")
failed (SSL: error:02001002:system library:fopen:No such file or
error:2006D080:BIO routines:BIO_new_file:no such file) 

it would be great to be able to use it here. 

Posted at Nginx Forum:,292653,292653#msg-292653

More information about the nginx mailing list