Hello!
On Tue, Feb 17, 2015 at 10:20 PM, Arvind Jayaprakash wrote:
>
> The problem is that the log_by_lua does not run when the upstream returns an
> error. This does not happen if proxy_intercept_errors is turned off. Is
> there any workaround for this?
>
proxy_intercept_errors initiates an "internal redirect" to a new
location (location @err in your case), so you need to configure
log_by_lua in that location because the original location is already
quit by the current request upon internal redirects (internal
redirects work like the "exec" command in shell, overriding the old
configurations in place).
Regards,
-agentzh