nginx-eval-module
nginx-eval-module copied to clipboard
"status 000" sometimes occurs when using eval with proxy_pass
We were using nginx-eval-module with NGINX 1.16.0 and a configuration of this form:
location / {
proxy_pass https://some_upstream_server/;
eval_override_content_type application/octet-stream;
eval $foo {
proxy_pass http://foo;
proxy_pass_request_headers off;
}
proxy_set_header Authorization $foo;
}
Clients send us POST requests, the eval module fetches a value, and we attach a header before forwarding the request.
Some fraction of the time, for some fraction of client implementations, NGINX would simply close the incoming TCP connection, while logging these values:
$status "000"
$upstream_status "-"
Lines like this also appeared in the --debug log:
*517 http client request body rest 217
*517 http client request body recv -2
I'm not trying to debug this anymore, because "This module is experimental and production use is discouraged", and the problem went away when I replaced eval
with rewrite_by_lua_block
+ ngx.location.capture()
.
I'm just posting this in case someone encounters similar errors in the future.