Welcome! Log In Create A New Profile


On limited variable usage

Simas Toleikis
August 30, 2010 07:10AM

So is there any reason why some configuration directives can't use certain


alias $document_root/my/stuff;

Will trigger "the $document_root variable may not be used in the "alias"
directive" error.

However, the following trick:

set $root $document_root;
alias $root/my/stuff;

... will simply remove this restriction.

And another note (not sure if it is related) but:

root /my/root;
access_log $document_root/logs/;

will expand into "/path/to/nginx/my/root/logs"

That is, it will prefix nginx install path when used in this way (might be a
bug?). And error_log directive seems to not allow variables at all.

I find this behavior very limiting that usually requires a lot of path
duplications in config file. So the question is, is there any reason why
variable expansion can't be unified and be the same for all directives?

nginx-devel mailing list
Subject Author Views Posted

On limited variable usage

Simas Toleikis 4166 August 30, 2010 07:10AM

Re: On limited variable usage

Maxim Dounin 1779 August 30, 2010 08:46AM

Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 346
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready