Hello,
I am building a nginx module which get parsed http requests send it to my server, wait for the response from my server and send the client http response.
The nginx close my client connections due to lingering_close:
#3 0x0000000000477647 in ngx_http_terminate_request (r=0x1cb1050, rc=-2) at src/http/ngx_http_request.c:2466
#4 0x0000000000476fb5 in ngx_http_finalize_request (r=0x1cb1050, rc=-2) at src/http/ngx_http_request.c:2303
#5 0x0000000000466b0a in ngx_http_core_content_phase (r=0x1cb1050, ph=0x1bcb6e8) at src/http/ngx_http_core_module.c:1370
#6 0x00000000004653b9 in ngx_http_core_run_phases (r=0x1cb1050) at src/http/ngx_http_core_module.c:847
#7 0x0000000000465304 in ngx_http_handler (r=0x1cb1050) at src/http/ngx_http_core_module.c:830
#8 0x00000000004762e3 in ngx_http_process_request (r=0x1cb1050) at src/http/ngx_http_request.c:1910
#9 0x0000000000474afe in ngx_http_process_request_headers (rev=0x1bcf350) at src/http/ngx_http_request.c:1342
#10 0x0000000000473e95 in ngx_http_process_request_line (rev=0x1bcf350) at src/http/ngx_http_request.c:1022
#11 0x0000000000453c68 in ngx_epoll_process_events (cycle=0x1b8c5c0, timer=500, flags=1) at src/event/modules/ngx_epoll_module.c:822
#12 0x0000000000442346 in ngx_process_events_and_timers (cycle=0x1b8c5c0) at src/event/ngx_event.c:242
#13 0x00000000004514df in ngx_worker_process_cycle (cycle=0x1b8c5c0, data=0x6) at src/os/unix/ngx_process_cycle.c:753
#14 0x000000000044d9a1 in ngx_spawn_process (cycle=0x1b8c5c0, proc=0x4513db <ngx_worker_process_cycle>, data=0x6, name=0x4f5793 "worker process", respawn=-3) at src/os/unix/ngx_process.c:198
#15 0x0000000000450257 in ngx_start_worker_processes (cycle=0x1b8c5c0, n=20, type=-3) at src/os/unix/ngx_process_cycle.c:358
#16 0x000000000044f7ec in ngx_master_process_cycle (cycle=0x1b8c5c0) at src/os/unix/ngx_process_cycle.c:130
#17 0x000000000040ff5c in main (argc=5, argv=0x7fff4c6c5698) at src/core/nginx.c:367
The flow close my request when it is still in progress.
I tried to configure the nginx conf in a few ways but got the same problem:
First config:
lingering_close on;
lingering_time 1000s;
lingering_timeout 600s;
Second config:
lingering_close always;
Third config:
lingering_close off;
Can I disable the flag?
Thanks!