问题
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?
回答1:
You can do this by modifying server.max-keep-alive-idle
. If you set this to 0
, then the connection will close right after the data is served
来源:https://stackoverflow.com/questions/6453661/lighttpd-force-close-connection