# Is HTTP 1.1 chuncked file encoding on upstream fastcgi servers working for nginx 1.2.4?

**URL:** <https://www.ruby-forum.com/t/is-http-1-1-chuncked-file-encoding-on-upstream-fastcgi-servers-working-for-nginx-1-2-4/229590>\
**Category:** NGINX\
**Created:** [February 7, 2013, 12:31pm UTC](https://www.ruby-forum.com/t/is-http-1-1-chuncked-file-encoding-on-upstream-fastcgi-servers-working-for-nginx-1-2-4/229590 "2013-02-07T12:31:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SirNoSkill](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@SirNoSkill](https://www.ruby-forum.com/u/SirNoSkill)\
**Post date:** [February 7, 2013, 12:31pm UTC](https://www.ruby-forum.com/t/is-http-1-1-chuncked-file-encoding-on-upstream-fastcgi-servers-working-for-nginx-1-2-4/229590/1 "2013-02-07T12:31:46Z")

</div>

Hi,

I have a question regarding nginx-fastcgi.

## I use nginx 1.2.4 from here:

## sudo -s nginx=stable # use nginx=development for latest development version add-apt-repository ppa:nginx/$nginx apt-get update apt-get install nginx

The, I use [ASP.NET](http://ASP.NET) MVC3 on Linux with nginx.  
To do that, I forward requests to nginx via fastcgi-mono-server4.

So far it works fine, except for this little problem here:

> <https://stackoverflow.com/questions/14662795/why-do-i-have-unwanted-extra-bytes-at-the-beginning-of-image>

which I have also forwarded to the mono mailing-list, here:  
[http://mono.1490590.n4.nabble.com/Bug-in-mono-3-0-1-MVC3-File-FileResult-td4658382.html](http://mono.1490590.n4.nabble.com/Bug-in-mono-3-0-1-MVC3-File-FileResult-td4658382.html)

It seems to have something todo with HTTP 1.1’s chunked transfer  
encoding via the fastcgi-mono-server4.  
So my question to the nginx people:  
Does this version of nginx (1.2.4) support HTTP 1.1 + chunked transfer  
encoding, and that also for the fastcgi-upstream servers ?  
Because according to links found via quora, it does.

Second, do I have to add any nginx config file variables to make it work  
?

I googled a bit and found these options:  
chunked\_transfer\_encoding on;  
fastcgi\_keep\_conn on;  
proxy\_http\_version 1.1;

If so, is this the correct place (see mono mailing list link for  
complete entry):

location / {  
root /home/danillo/www/HomePage;  
#index index.html index.htm default.aspx Default.aspx;  
#fastcgi\_index Default.aspx;  
fastcgi\_pass 127.0.0.1:9000;  
include /etc/nginx/fastcgi\_params;  
chunked\_transfer\_encoding on;  
proxy\_http\_version 1.1;  
#fastcgi\_keep\_conn on;  
}

Or are the 3 options mentioned above “ON” by default, so that I do not  
need to specify them ?  
Am I missing something configuration-wise ?

Because I just want to rule out the possibility of this actually being a  
nginx or a missing-nginx-configuration-option bug.

–  
NoSkillz  
removed\_email\_address@domain.invalid

–  
[http://www.fastmail.fm](http://www.fastmail.fm) - Or how I learned to stop worrying and  
love email again

---

<div class="post-metadata">

**Author:** ![SirNoSkill](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@SirNoSkill](https://www.ruby-forum.com/u/SirNoSkill)\
**Post date:** [February 7, 2013, 1:04pm UTC](https://www.ruby-forum.com/t/is-http-1-1-chuncked-file-encoding-on-upstream-fastcgi-servers-working-for-nginx-1-2-4/229590/2 "2013-02-07T13:04:30Z")

</div>

Hello!

On Thu, Feb 07, 2013 at 03:31:02AM -0800, SirNoSkill wrote:

> apt-get install nginx
> 
> It seems to have something todo with HTTP 1.1’s chunked transfer  
> encoding via the fastcgi-mono-server4.  
> So my question to the nginx people:  
> Does this version of nginx (1.2.4) support HTTP 1.1 + chunked transfer  
> encoding, and that also for the fastcgi-upstream servers ?

It’s bad idea to use “Transfer-Encoding” while working via CGI and  
derived protocols like FastCGI. Quote from RFC 3875,

> **[RFC 3875: The Common Gateway Interface (CGI) Version 1.1 | RFC Editor](https://www.rfc-editor.org/info/rfc3875/)**
>
> The Common Gateway Interface (CGI) is a simple interface for running external programs, software or gateways under an information server in a platform-independent manner. Currently, the supported information servers are HTTP servers.
> 
> The interface...

The script MUST NOT return any header fields that relate to  
client-side communication issues and could affect the server’s  
ability to send the response to the client.

As you are talking to nginx via FastCGI, not HTTP, it won’t try to  
dig into content returned and decode it according to any  
Transfer-Encoding. Instead, the “Transfer-Encoding” header  
returned will be just dropped by nginx as per RFC 3875.

–  
Maxim D.

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.
