Strange characters added by nginx?

Maxim Dounin mdounin at
Tue Nov 4 17:45:40 MSK 2008


On Tue, Nov 04, 2008 at 02:06:05PM +0100, Rafał Zawadzki wrote:

> When i am trying to run my application via fastcig nginx adds some
> strange character, which are rendered by browser and destroy layout ;)
> Anyway - two examples of the same response, one is done via nginx, the
> second one by plain python (django).
> Any idea?
> root at sensias1 [~]# nginx -v
> nginx version: nginx/0.6.32
> root at sensias1 [~]#
> Version with nginx:
> HTTP/1.1 200 OK
> Server: nginx/0.6.32
> Date: Tue, 04 Nov 2008 13:00:41 GMT
> Content-Type: text/html; charset=utf-8
> Transfer-Encoding: chunked
> Connection: close
> Vary: Accept-Language, Cookie
> Content-Language: londonlist
> Cache-control: no-cache, must-revalidate, max-age=3600
> Set-Cookie: sessionid=20dedac7897a460f639f5eea64dc2246.1225803641.71; expires=Tue, 18-Nov-2008 13:00:41 GMT; Max-Age=1209600; Path=/;
> Set-Cookie: clipboard="{'advert': [], 'query': []}"; Path=/;
> 1e78
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

It looks like normal chunked transfer encoding, exactly as 
specified in headers (note "Transfer-Encoding: chunked").  Your 
browser shouldn't render "1e78" as long as it's HTTP/1.1 complaint 
(and nginx won't send chunked unless request is HTTP/1.1).

Could you please confirm that the output in question is what you 
got on the wire, not something transcoded by your debugging tool 
(if unsure - retry request by hand via telnet)?  And could you 
please name the browser you are using?

Maxim Dounin

p.s. Common problem discussed many times here involves backend 
incorrectly returning chunked to nginx, resulting in double 
chunked encoding sent to client.  But this shouldn't be the case 
with fastcgi, it only can manifest itself with proxy_pass.

More information about the nginx mailing list