title: $host_name variable in SSL certificate path in Nginx
body: <p>I'm trying to set up a default server in nginx with SSL, path to SSL certificate should contain sitename, something like that</p>
  <pre><code>server {
      listen 80 default_server;
      listen 443 ssl default_server;
      server_name _;
      ssl_certificate ssl/$host_name/fullchain.pem;
      ssl_certificate_key ssl/$host_name/privkey.pem;
  </code></pre>
  <p>and it doesn't work - in error log</p>
  <pre><code>cannot load certificate &quot;/etc/nginx/ssl//fullchain.pem&quot;
  </code></pre>
  <p>If I print this variable in headers with <code>add_header XX &quot;$http_host&quot;;</code>
  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 <code>ssl_certificate</code> parameter everything is working fine</p>