Closed A-Scott-Rowe closed 4 years ago
i meet the same problem, the concurrent level will increase in case of upstream connection errors
What about using https://github.com/tokers/lua-resty-ctxdump to stash ctx before proxy and apply it back in log_by_lua/error_page block?
@spacewander Thanks. I have tested. It seems lua-resty-ctxdump module can solve the internal requests losing main request's ctx problem.
The ctx
is cleared by Nginx when it does internal redirect. As the workaround works I decide to close this issue. Feel free to reopen it if you still have problem.
We are using
incoming
andleaving
the same was as in the example in the readme. however when the server errors we redirect to an error page, this causes the context to be cleared and we lose the saved connection.is there a more graceful way to
leave
the connection in this situation other than opening a new connection in the error handling code?