> Would it be possible to sniff the inbound and outbound connections on > the mod_proxy machine using tcpflow to see who is saying what to what? > I'd like to check the headers that are being sent and received, I have a > hunch that the content-length header is not being sent correctly.
OK, after much testing, this is what I have discovered: Chunked responses work just fine. Backend server replies consisting of only headers are not returned to the browser by the proxy until the connection to the backend times out and is closed. Explicitly disabling keepalive on the backend (with "Setenv nokeepalive") causes mod_proxy to return only the headers, and not the payload, to the client for non-200 requests. Here's an example session... Apache 2.0.16 with mod_proxy from 4/19 is serving on 128.84.154.54:8080 and proxying requests to Apache 1.3.12 serving on 127.0.0.1:899. ---------------------------------- Session between mod_proxy and 1.3: ---------------------------------- GET /%7Ecarson/foo HTTP/1.1 Host: localhost:899 Accept: */* Accept-Encoding: gzip,deflate,compress,identity Accept-Language: en User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.3 i686; en-US; 0.8.1) Gecko/20010326 Max-Forwards: 10 X-Forwarded-For: 128.84.223.104 X-Forwarded-Host: marduk.litech.org:8080 X-Forwarded-Server: www.litech.org HTTP/1.1 404 Not Found Date: Mon, 23 Apr 2001 21:44:13 GMT Server: Apache/1.3.12 (Unix) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24_01 PHP/4 .0.3pl1 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 110 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>404 Not Found</TITLE> </HEAD><BODY> <H1>Not Found</H1> The requested URL /~carson/foo was not found on this server.<P> <HR> <ADDRESS>Apache/1.3.12 Server at localhost Port 899</ADDRESS> </BODY></HTML> 0 ---------------END---------------- However, the client doesn't get the nice error message. Here's what the client sees: -------------------------------- Session between Mozilla and 2.0: -------------------------------- GET /~carson/foo HTTP/1.1 Host: marduk.litech.org:8080 User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.3 i686; en-US; 0.8.1) Gecko/20010326 Accept: */* Accept-Language: en Accept-Encoding: gzip,deflate,compress,identity Keep-Alive: 300 Connection: keep-alive HTTP/1.1 404 Not Found Date: Mon, 23 Apr 2001 21:44:13 GMT Server: Apache/2.0.16 (Unix) Content-Type: text/html; charset=iso-8859-1 Content-Length: 0 -----------------END--------------------- I'm not sure what's going on here. This is what I get when I turn on debugging: [Mon Apr 23 18:08:59 2001] [notice] Apache/2.0.16 (Unix) configured -- resuming normal operations [Mon Apr 23 18:08:59 2001] [info] Server built: Apr 23 2001 16:43:55 [Mon Apr 23 18:09:09 2001] [debug] proxy_http.c(98): proxy: HTTP: canonicalising URL //localhost:899/~carson/foo [Mon Apr 23 18:09:09 2001] [debug] mod_proxy.c(386): Trying to run scheme_handler [Mon Apr 23 18:09:09 2001] [debug] proxy_http.c(235): proxy: HTTP: serving URL http://localhost:899/%7Ecarson/foo [Mon Apr 23 18:09:09 2001] [debug] proxy_http.c(263): proxy: HTTP connecting http://localhost:899/%7Ecarson/foo to localhost:899 [Mon Apr 23 18:09:09 2001] [debug] proxy_http.c(380): proxy: socket has been created [Mon Apr 23 18:09:09 2001] [debug] proxy_http.c(427): proxy: socket is connected [Mon Apr 23 18:09:09 2001] [debug] proxy_http.c(444): proxy: connection complete [Mon Apr 23 18:09:09 2001] [debug] proxy_http.c(773): proxy: start body send [Mon Apr 23 18:09:09 2001] [debug] proxy_http.c(787): proxy: end body send Sorry for the poor formatting. Anyway, I hope this helps. Let me know if you need anything more. -Nathan -- +-------------------+---------------------+------------------------+ | Nathan Lutchansky | [EMAIL PROTECTED] | Lithium Technologies | +------------------------------------------------------------------+ | I dread success. To have succeeded is to have finished one's | | business on earth... I like a state of continual becoming, | | with a goal in front and not behind. - George Bernard Shaw | +------------------------------------------------------------------+
