ngx_http_terminate_request() then calls ngx_http_close_request(), which finally calls ngx_http_free_request() and ngx_http_close_connection(). The first logs the request, and the second calls ngx_close_connection(), which leads us to ngx_close_socket(), i.e. close().
Some other cases
ngx_http_upstream_init_request() first sets both event handlers to check for broken connections.
If request body is not buffered, ngx_http_upstream_send_request_body() sets the read_event_handler to ngx_http_upstream_read_request_handler, but restores it to ngx_http_upstream_rd_check_broken_connection() once the client request body is fully read.
Both check functions call ngx_http_upstream_check_broken_connection(), which would finalize the client-side connection in the same way.