Error handling from filter modules

Steven Hartland steven.hartland at
Fri Oct 16 16:49:39 UTC 2015

After doing some more digging is seems a better manual call would be:
return ngx_http_filter_finalize_request(r, &module, 

But it still leaves the question is it ever sensible to allow bad 
responses to be returned to the client in the case NGX_ERROR is returned 
from a filter?

On 16/10/2015 02:36, Steven Hartland wrote:
> I'm making changes to a filter module and when it detected an error it
> returned NGX_ERROR however the response generated to the client isn't
> the expected 500 internal server error I would have expected given said
> return.
> So the question is do filters have to manually call
> ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); or is it
> expected that the upper layers should actually do the right thing and
> ensure the client doesn't get a bad response generated from the current
> state of r with no indication an error occurred?
>     Regards
>     Steve

More information about the nginx-devel mailing list