Welcome! Log In Create A New Profile

Advanced

Inconsistency in ability to use variables in nginx config

November 13, 2013 01:25AM
It seems like it's possible to use variables in some configuration directives but not in others. This works:

root /usr/www/$sitename/httpdocs;

works, while these:

access_log /var/log/www/$sitename/access.log;
proxy_cache $sitename;

do not, instead generating errors when I try to restart nginx.

Is there any documentation that explains where I can and cannot use a variable? Or is there some syntax I should be using to indicate variable interpolation? It would be immensely helpful if they worked in all these contexts, because then we wouldn't have to repeat so much across different site configuration files, leading to the requirement for generating them with clunky scripts. As it is, the variables are of very limited utility.
Subject Author Posted

Inconsistency in ability to use variables in nginx config

miguel_hamster November 13, 2013 01:25AM

Re: Inconsistency in ability to use variables in nginx config

Valentin V. Bartenev November 13, 2013 05:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready