I have a lighttpd 1.4.35 running, and I need it to close the connection after every HTTP request. I'm expecting to see the "Connection:close" header in HTTP responses, but I don't. I receive something like this:
% curl -i http://192.168.12.1/files/
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 1554
Date: Sat, 22 May 2021 16:29:05 GMT
Server: lighttpd/1.4.35
In order to have it send the "Connection: close" header, I added the following to the lighttpd.conf:
server.max-keep-alive-idle = 0
server.max-keep-alive-requests = 0
setenv.add-response-header = ( "connection" => "close" )
But I don't see any difference in the header. Am I missing something?
Note: the reason I am doing this is that in my setup (it's an embedded system), I can have only one TCP connection my lighttpd at a time, so I don't want a client to keep it alive and blocking other clients. Instead I want every client to close its TCP connection after every HTTP request, and for that I believe that my lighttpd should send Connection:close
to inform e.g. Firefox to close the connection.