Variables and includes

Daniel L. Miller dmiller at amfes.com
Sun Jan 13 05:40:14 UTC 2013


Is it possible to use a variable from one configuration in a included 
config file?  Example:

set $a = "hello";
include test.conf;

[test.conf]
if ($a = "hello") {
     set $a = "world";
}
# something that works with $a

Within the scope of the commands of test.conf, will $a be "hello" or 
"world"?  Currently my usage like this gives me a, "using unitialized 
variable" warning.
-- 
Daniel



More information about the nginx mailing list