Nginx – Content-length does not appear with nginx and php files

http-headersnginxweb-server

I have a nginx server which serve a website.
With my browser i can reach index.php, but when i look at the headers with firebug, i can't see the content-length on any php files, but for example i can see it on html files.

With a apache server, i can see this content-length on every type of file.

I use a loadbalancer that's why i need this parameter to be sent!

Have you ever had this kind of problem with nginx ?

Best Answer

This is chunked encoding (you'll see a Transfer-Encoding: chunked header), and understanding this encoding in place of Content-Length is a requirement for any HTTP/1.1-compliant application.

From the RFC: All HTTP/1.1 applications MUST be able to receive and decode the "chunked" transfer-coding.

nginx is behaving properly; if your load balancer can't handle it, but still acts like an HTTP/1.1 system, then it's the one to blame. What kind of load balancer is it?