I have the same question, any update on it. I am using Lua and Redis for the reverse proxy lookup and don't define upstream. How can we use keepalive? Posted at Nginx Forum: https://forum.nginx.org/read.php?2,248924,263444#msg-263444