# Fast CGI module "multipart/mixed" problem (it only accepts 1 "Content-Type" header)

**URL:** <https://www.ruby-forum.com/t/fast-cgi-module-multipart-mixed-problem-it-only-accepts-1-content-type-header/238527>\
**Category:** NGINX\
**Created:** [January 15, 2014, 5:57pm UTC](https://www.ruby-forum.com/t/fast-cgi-module-multipart-mixed-problem-it-only-accepts-1-content-type-header/238527 "2014-01-15T17:57:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [January 15, 2014, 5:57pm UTC](https://www.ruby-forum.com/t/fast-cgi-module-multipart-mixed-problem-it-only-accepts-1-content-type-header/238527/1 "2014-01-15T17:57:13Z")

</div>

It seems, when my FCGI server responds to NGINX with “Status: 200  
OK\r\nContent-Type:  
multipart/mixed;boundary=whatever\r\n\r\nboundary=whatever\r\nContent-Type:  
image/jpeg\r\n\r\n”

The FASTCGI module is taking the 2nd “Content-Type” only and uses it in  
the  
initial response with the 200.

The client gets confused when it sees the boundaries and data later.  
If I remove the subsequent “Content-Type:” headers, the initial one with  
the  
boundary indicator is sent; however, the client now does not know how to  
interpret the .

Posted at Nginx Forum:

> **[Fast CGI module "multipart/mixed" problem (it only accepts 1 "Content-Type"...](https://forum.nginx.org/read.php?2,246487,246487#msg-246487)**
>
> It seems, when my FCGI server responds to NGINX with "Status: 200 OK\\r\\nContent-Type: multipart/mixed;boundary=whatever\\r\\n\\r\\nboundary=whatever\\r\\nContent-Type: image/jpeg\\r\\n\\r\\n\<BINARY DATA\>" The FASTCGI module is taking the 2nd...

---

<div class="post-metadata">

**Author:** ![ariesone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e9c0ed/32.png) [@ariesone](https://www.ruby-forum.com/u/ariesone)\
**Post date:** [January 16, 2014, 4:59pm UTC](https://www.ruby-forum.com/t/fast-cgi-module-multipart-mixed-problem-it-only-accepts-1-content-type-header/238527/2 "2014-01-16T16:59:00Z")

</div>

Hello!

On Wed, Jan 15, 2014 at 11:56:30AM -0500, ariesone wrote:

> boundary indicator is sent; however, the client now does not know how to  
> interpret the .

The second Content-Type header is expected to be in response body  
from nginx point of view (i.e., after double CRLF which marks end  
of headers), and nginx shouldn’t try to interpret it anyhow.

While string you provided looks correct at a first glance, it may  
be incorrect depending on language and OS used (e.g., in Perl on  
Windows it will likely produce wrong results due to “\n” expanded  
to CRLF). Symptoms suggest this is likely the cause and you  
should focus on what your app actually returns.

–  
Maxim D.  
[http://nginx.org/](http://nginx.org/)
