I have switched my local setup to use HTTP instead of HTTPS so that I can compare all HTTP Requests and Responses with ngrep. I had side-by-side terminals opened. The Requests were all ok, Here is the request from browser to pound:
GET /nginx-poll/?key=abc HTTP/1.1.
Host: example:8080.
Connection: keep-alive.
Cache-Control: no-cache.
If-Modified-Since: Wed, 09 May 2012 15:28:25 GMT.
Pragma: no-cache.
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19.
If-None-Match: 0.
Accept: */*.
Accept-Encoding: gzip,deflate,sdch.
Accept-Language: en-US,en;q=0.8.
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3.
Cookie: BUNCH_OF_COOKIES.
.
And here is the HTTP Request the pound sends to Nginx:
GET /nginx-poll/?key=abc HTTP/1.1.
Connection: keep-alive.
Cache-Control: no-cache.
If-Modified-Since: Wed, 09 May 2012 15:28:25 GMT.
Pragma: no-cache.
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19.
If-None-Match: 0.
Accept: */*.
Accept-Encoding: gzip,deflate,sdch.
Accept-Language: en-US,en;q=0.8.
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3.
Cookie: BUNCH_OF
_COOKIES.
X-Forwarded-For: 127.0.0.1.
.
And now the corresponding responses. First, we start wit the Response of Nginx:
HTTP/1.1 304 Not Modified.
Date: Wed, 09 May 2012 15:28:45 GMT.
Content-Type: application/json.
Last-Modified: Wed, 09 May 2012 15:28:45 GMT.
Connection: keep-alive.
Transfer-Encoding: chunked.
Etag: 0.
.
0.
.
As we can see, there is chunk which ends the response.
And here comes the response the pound sends from Nginx to the browser:
HTTP/1.1 304 Not Modified.
Date: Wed, 09 May 2012 15:28:45 GMT.
Content-Type: application/json.
Last-Modified: Wed, 09 May 2012 15:28:45 GMT.
Connection: keep-alive.
Transfer-Encoding: chunked.
Etag: 0.
.
As you can see immidiately, there is no chunk which ends this message and Google Chrome cannot parse the complete response. Due to the fact that Google Chrome is really strict in parsing chunked response messages, this issue should be fixed in pound.
On Tue, May 8, 2012 at 9:15 AM, Dennis Becker
<becker@sipgate.de> wrote:
Hi,
we have a setup where pound is the load balancer in front of a NGinx Long Polling server. I can reproduce an issue where after a long poll ends with "HTTP 304 not modified", the next HTTP response message is corrupt. You'll get in Google Chrome messages like this:
0
HTTP/1.1 200 OK
Server: nginx/1.0.14
Date: Tue, 08 May 2012 05:58:03 GMT
Content-Type: application/json
Last-Modified: Tue, 08 May 2012 05:57:33 GMT
Connection: close
Etag: 0
Transfer-Encoding: chunked
2159
{"REMOVED_BODY_CONTENT"}
I also have this issue with a Lighttpd behind Pound using chunked encoding.
--
Dennis Becker becker@sipgate.de
Telefon: +49 (0) 211-63 55 55-97
Telefax: +49 (0) 211-63 55 55-22
sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf
HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois
Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391
www.sipgate.de - www.sipgate.at - www.sipgate.co.uk
--
Dennis Becker
becker@sipgate.de Telefon: +49 (0) 211-63 55 55-97
Telefax: +49 (0) 211-63 55 55-22
sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf
HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois
Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391
www.sipgate.de -
www.sipgate.at -
www.sipgate.co.uk