I found worker_shutdown_timeout and the code for graceful shutdown was fairly easy to follow, so we've patched it to do what we want. Thanks! Posted at Nginx Forum: https://forum.nginx.org/read.php?2,275328,275370#msg-275370