I'm trying to set up a default server in nginx with SSL, path to SSL certificate should contain sitename, something like that
server {
listen 80 default_server;
listen 443 ssl default_server;
server_name _;
ssl_certificate ssl/$http_host/fullchain.pem;
ssl_certificate_key ssl/$http_host/privkey.pem;
and it doesn't work - in error log
cannot load certificate "/etc/nginx/ssl//fullchain.pem"
If I print this variable in headers with add_header XX "$http_host"; it shows the proper sitename. Is there any way to use sitename in certificate path? There are a lot of sites on my server with typical config so it's better for me to have just one config. Nginx version 1.18 and if I manually define some variable and put it in ssl_certificate
parameter everything is working fine