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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
sbwoodside (Guest)
on 2009-04-30 06: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:
  https://issues.apache.org/bugzilla/show_bug.cgi?id=13986

The crux of the conclusion is from this passage in RFC 2616 (
http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.h... ):

 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). ( http://www.ietf.org/rfc/rfc2046.txt
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:
http://forum.nginx.org/read.php?2,1577,1577#msg-1577
This topic is locked and can not be replied to.