Bug #1877

lighttpd fails to respond with proxy backend with Proxy-Connection: header

Added by glen over 11 years ago. Updated over 11 years ago.

Target version:


i have such setup (lighttpd->squid->lighttpd)

1. lighttpd on public.ip:80 with config:

$HTTP["host"] == "somehost" {
  proxy.server = ("" => (( "host" => "proxy.ip", "port" => "80" )))

2. squid listening on proxy.ip:80
squid is sending all requests to backend.ip:80

3. lighttpd listening on backend.ip:80

when i send request to public.ip:80 with following headers:

Proxy-Connection: keep-alive

then first lighttpd never answers the response:

nc -vv public.ip 80 < rp.txt [public.ip] 80 (ndl-aas) open

however if i remove squid from middle, it works okay.

so i guess the problem is that Proxy-Connection: header SHOULD NOT SENT TO BACKEND unless lighty is really handling it


lighttpd-bug-1877.patch (477 Bytes) lighttpd-bug-1877.patch glen, 2009-01-16 17:12

Updated by glen over 11 years ago

enabling proxy.debug = 1 :

2009-01-16 18:56:00: (mod_proxy.c.1087) proxy - start
2009-01-16 18:56:00: (mod_proxy.c.1125) proxy - ext found
2009-01-16 18:56:00: (mod_proxy.c.1259) proxy - found a host proxy.ip 80
2009-01-16 18:56:00: (mod_proxy.c.377) connect delayed: 9
2009-01-16 18:56:00: (mod_proxy.c.999) proxy: fdevent-out 1
2009-01-16 18:56:00: (mod_proxy.c.810) proxy - connect - delayed success
2009-01-16 18:56:00: (mod_proxy.c.966) proxy: fdevent-in 4
2009-01-16 18:56:00: (mod_proxy.c.650) proxy - have to read: 407


Updated by glen over 11 years ago

  • Patch available changed from No to Yes

Updated by glen over 11 years ago

here's my patch, it solves the problem, however i'm not sure is it accurate to do so


Updated by stbuehler over 11 years ago

Not a bug in lighttpd imho.

Perhaps we should filter that stupid header anyway, but i don't like it.


Updated by glen over 11 years ago

after reading that doc, i'd say we do right thing dropping it, as "connection persistence is, by its very nature, a single-hop concept.", and if lighty at some point supports persistent connections to backend http servers, it should add and handle it by itself.


Updated by glen over 11 years ago

tested with 1.5 (r2371) and the problem doesn't occour in 1.5 code.


Updated by glen over 11 years ago

  • Assignee set to glen
  • % Done changed from 0 to 100

applied in r2372 for 1.4


Updated by glen over 11 years ago

  • Target version set to 1.4.21

Updated by glen over 11 years ago

  • Status changed from New to Fixed

Also available in: Atom