Nginx phase of passenger_env_var?

53 views
Skip to first unread message

Boris Kheyfets

unread,
Apr 13, 2016, 1:51:52 PM4/13/16
to Phusion Passenger Discussions
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?




Boris Kheyfets

unread,
Apr 14, 2016, 3:06:06 AM4/14/16
to Phusion Passenger Discussions
Using set instead of set_by_lua also doesn't work:

set $PG_USER boris;
passenger_env_var PG_USER $PG_USER;


Daniel Knoppel

unread,
Apr 14, 2016, 4:39:42 AM4/14/16
to Phusion Passenger Discussions
This is a known request for enhancement:

- Daniel
Reply all
Reply to author
Forward
0 new messages