Bug #1877

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

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

Status:FixedStart date:2009-01-16
Priority:NormalDue date:
Assignee:glen% Done:

100%

Category:mod_proxy
Target version:1.4.21
Missing in 1.5.x:

Description

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:

GET http://some.name/ HTTP/1.1
Host: some.name
Proxy-Connection: keep-alive

then first lighttpd never answers the response:

nc -vv public.ip 80 < rp.txt
ado2.delfi.ee [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 Magnifier (477 Bytes) glen, 2009-01-16 17:12

Associated revisions

Revision 2372
Added by glen over 5 years ago

- Do not pass Proxy-Connection: header from client to backend http server in mod_proxy (#1877)

History

#1 Updated by glen over 5 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

#2 Updated by glen over 5 years ago

  • Patch available changed from No to Yes

#3 Updated by glen over 5 years ago

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

#4 Updated by stbuehler over 5 years ago

Not a bug in lighttpd imho.

http://homepages.tesco.net/J.deBoynePollard/FGA/web-proxy-connection-header.html

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

#5 Updated by glen over 5 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.

#6 Updated by glen over 5 years ago

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

#7 Updated by glen over 5 years ago

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

applied in r2372 for 1.4

#8 Updated by glen over 5 years ago

  • Target version set to 1.4.21

#9 Updated by glen over 5 years ago

  • Status changed from New to Fixed

Also available in: Atom