However, if I replace the first argument to echo_subrequest directive with a static string:
echo_subrequest 'GET' '/$originalURL' -q '$args';
The subrequest executes as intended.
It seems that ngx_http_echo_eval_cmd_args falters a bit if the first argument passed to it is a variable (i.e. value[i].lengths != NULL). In that case, it continues to expect opts (expects_opts remains 1) and it misinterprets the -q as an opt instead of an arg in the third iteration.
With this config:
When I try to execute:
I get this in my
errors.log
:However, if I replace the first argument to
echo_subrequest
directive with a static string:The subrequest executes as intended.
It seems that
ngx_http_echo_eval_cmd_args
falters a bit if the first argument passed to it is a variable (i.e.value[i].lengths != NULL
). In that case, it continues to expectopts
(expects_opts
remains1
) and it misinterprets the-q
as anopt
instead of anarg
in the third iteration.