Lighttpd as proxy drops the connection

Added by svanegmond over 14 years ago


I'm running lighttpd in two layers. The outer layer acts as a load balancer and proxy into back-end servers, which are themselves running lighttpd + php5 via fastcgi.

Everything is Debian Testing:

  1. uname -a
    Linux magrathea 2.6.26-tp13-openvz #1 SMP Tue Jul 21 15:56:05 EDT 2009 x86_64 GNU/Linux
  1. lighttpd -v
    lighttpd/1.4.25 (ssl) - a light and fast webserver
    Build-Date: Nov 30 2009 13:53:48

If you load that page, and click 'reload', after about 4 or 5 tries eventually you'll get a damaged page rendering. Watching the TCP packets go by, this coincides with lighttpd with proxying responsibility just dropping the connection after receiving all headers. Firefox tries to compensate by fetching the page out of its local cache, and bungles it, hence the rendering that is observed. Safari, in contrast, re-requests the page several times over until it finally gets a reply.

So far as I know, lighttpd should at least produce a response, even if the back-end server is misbehaving? (Which I can confirm it's not.)

Nothing at all in the error log at the time this happens.

All other sites that run along the same proxy path (e.g. ) do not produce this problem in Firefox.

The config file we're running is at
A packet dump excerpt is at

Truly baffling.

Replies (1)

RE: Lighttpd as proxy drops the connection - Added by svanegmond over 14 years ago

Turns out I don't know my FIN from my ACK.

Turns out it was the browser dropping the connection. The images files on the page had extra junk appended to them. This seems to have really given the browser indigestion.