How I can use a variable name in file path ?
ssl_certificate /home/ec2-user/.certificados/$server_name.crt;
ssl_certificate_key /home/ec2-user/.certificados/$server_name.key;
nginx
How I can use a variable name in file path ?
ssl_certificate /home/ec2-user/.certificados/$server_name.crt;
ssl_certificate_key /home/ec2-user/.certificados/$server_name.key;
Best Answer
You cannot use variables in every directive.
ssl_certificate
is treated as a literal string and is one of the many directives where variables are unsupported.To specify different certificates for hosts, you have to explicitly write it in a server block:
If you feel uncomfortable duplicating the configuration, create templates and generate the nginx configuration using those templates. See also http://nginx.org/en/docs/faq/variables_in_config.html.