Forum: NGINX default_type should default to nothing (RFC 2616)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 sbwoodside (Guest)
on 2009-04-30 04:50
(Received via mailing list)
I am new to nginx but I just noticed that, at least on ubuntu,

default_type  application/octet-stream;

is the default setting, and the wiki says that if I remove it, the
default will go to text/plain. This is not good!

For an extremely detailed discussion of this issue, please see the
resolved/fixed bug for apache:

The crux of the conclusion is from this passage in RFC 2616 ( ):

 Any HTTP/1.1 message containing an entity-body SHOULD include a
Content-Type header field defining the media type of that body. If and
only if the media type is not given by a Content-Type field, the
recipient MAY attempt to guess the media type via inspection of its
content and/or the name extension(s) of the URI used to identify the
resource. If the media type remains unknown, the recipient SHOULD treat
it as type "application/octet-stream".

Note that in this context "SHOULD" means it's advised but not mandatory.
In particular. The receiver is ONLY allowed to guess the type if the
media type is missing. Now, IE ignores that rule, but Mozilla does not,
which is why the Mozilla engineers wanted so badly for apache to change
the setting! Per RFC 2046, "application/octet-stream" actually means
"arbitrary binary data" which the application is recommended to simply
save (not try to guess the type). (
section 4.5.1 )

I hope you can allow me to set default_type to None or leave it unset
and have nginx send no Content-Type header. Thanks!

Posted at Nginx Forum:,1577,1577#msg-1577
This topic is locked and can not be replied to.