Hi all,
I'm trying to pass secrets with
set_by_lua in
nginx.conf with the help of
passenger_env_var. However it doesn't work:
set_by_lua $PG_USER 'return os.getenv("PG_USER")';
passenger_env_var PG_USER $PG_USER;neither this works:
set_by_lua $PG_USER 'return "boris"';
passenger_env_var PG_USER $PG_USER;Using the string directly works:
passenger_env_var PG_USER boris;All of these happen in the
server context. Docs
say set_by_lua happens at rewrite phase, and I guess they refer to
NGX_HTTP_REWRITE_PHASE. I suspect the behavior above is related to the nginx phase of the
passenger_env_var. However, it phase is not mentioned in the
docs. So my question is what is: what phase does
passenger_env_var occurs at?