Hi all,
I've been trying to set variables in openresty by getting them from my running OS.
I've read all I can find on the subject but I can't get it right.
Here's my code sniper:
1) Sets the environment in the nginx.conf file:
env APPLICATION;
env INDEX;
env SERVERNAME;
env VAR_PREFIX;
env NGINX_PREFIX;
2) Then is try to get the environment variables:
#env Variables set by default or on run time
set_by_lua $application 'return os.getenv("APPPLICATION")';
set_by_lua $index 'return os.getenv("INDEX")';
set_by_lua $servername 'return os.getenv("SERVERNAME")';
set_by_lua $var_prefix 'return os.getenv("VAR_PREFIX")';
set_by_lua $nginx_prefix 'return os.getenv("NGINX_PREFIX")';
3) Try to access them inside the same file:
error_log $var_prefix/error.log;
Help is very much welcome