Post action after client closes connection

Mobczynski Mobczynski lists at
Wed Apr 29 18:48:53 MSD 2009

This is my scenario:
* client connects to nginx (proxy_ignore_client_abort is on at this
* nginx sends data from upstream (received by subrequests) back to
* when request finishes I want to send confirmation using GET method to
other upstream
Everything is ok when client downloads all data, then I'm using:
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
clcf->post_action = location of upstream
and rest is done during finalization of main request. Great.

The problem is when client closes connection during download. If it
happens during main request it is handled properly:

2009/04/29 15:09:46 [debug] 13740#0: *7 http test reading
2009/04/29 15:09:46 [info] 13740#0: *7 client closed prematurely
connection, client:, server: localhost, request: "GET
/download/plik2 HTTP/1.0", upstream:
"", host: "localhost"
2009/04/29 15:09:46 [debug] 13740#0: *7 http finalize request: 0,
2009/04/29 15:09:46 [debug] 13740#0: *7 post action:
2009/04/29 15:09:46 [debug] 13740#0: *7 internal redirect:

But if it happens during subrequest, post action isn't activated:

2009/04/29 13:55:06 [debug] 12147#0: *13 http test reading
2009/04/29 13:55:06 [info] 12147#0: *13 client closed prematurely
connection, client:, server: localhost, request: "GET
/download/plik2 HTTP/1.0", subrequest: "/send", host: "localhost"
2009/04/29 13:55:06 [debug] 12147#0: *13 http finalize request: 0,
2009/04/29 13:55:06 [debug] 12147#0: *13 http close request
2009/04/29 13:55:06 [debug] 12147#0: *13 http log handler
2009/04/29 13:55:06 [debug] 12147#0: *13 free: 08FA3660

I have even tried setting own handler for ngx_http_post_subrequest_t in
subrequest and initate from it another subrequest to upstream to confirm
download status, but then it doesn't seem to work (nothing is sent).

Any ideas?

Thanks in advance,
Posted via

More information about the nginx mailing list