Force connection close lighttpd

http-headerslighttpd

I have a M2M project that sends out the following headers.

HTTP/1.1
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate 
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: xxx.xxx.xxx.xxx:xxxx
RANGE:bytes=0-1023
Connection: Keep-Alive

Apache and ISS have connection : close in the response headers, regardless of the request to keep-alive. Lighttpd I assume is actually performing correctly as it does keep the connection alive, or does not send a connection : close. I actually need it to close the connection for the M2M machine to work. I tried

 setenv.add-response-header = ( "connection" => "close" )

But this is ignored, anyway to force a connection close?

Best Answer

Setting server.max-keep-alive-requests to 0 should cause Lighttpd to close the connection after each request.

server.max-keep-alive-requests = 0
Related Topic