Pass Lua variable in proxy pass directive

Francis Daly francis at
Tue May 31 18:46:30 UTC 2022

On Tue, May 31, 2022 at 01:53:20AM -0400, husaindalroti wrote:

Hi there,

> Is it possible to pass lua variable in proxy pass directive which we define
> using set_by_lua_file directive ?

Untested, but the documentation suggests that it should work.

> set_by_lua_file $ref test.lua; 
> proxy_pass '$ref';

Perhaps use:

    proxy_pass $ref;

without the quotes, to match most examples of using variables in

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list