issue with `default_type` & `type` on 1.5.7

Maxim Dounin mdounin at mdounin.ru
Thu Jan 9 13:18:09 UTC 2014


Hello!

On Sat, Jan 04, 2014 at 03:36:33PM -0500, Jonathan Vanasco wrote:

> I recently encountered an issue with a 1.5.7 branch on OSX.  i did not check 1.5.8
> 
> The following code will set ALL css/js files as the default_type
> 
>     include       /usr/local/nginx/conf/mime.types;
>     default_type  application/octet-stream;
> 
> 
> The following code works as intended
> 
>     default_type  application/octet-stream;
>     include       /usr/local/nginx/conf/mime.types;
> 
> I haven't had time to test on other versions. 
> 
> This could be the intended behavior, but the docs don't suggest 
> that.  usually a default_type only applies when the real type 
> can't be found.

Most likely there is a directive with some non-strict syntax (like 
"index") before they configuration you've quoted, and there is no 
semicolon after it.  E.g., something like this:

    index         index.html
    include       /usr/local/nginx/conf/mime.types;
    default_type  application/octet-stream;

While the configuration looks like correct one with mime.types 
included, it's instead defines 3 index files ("index.html", 
"include", "/usr/local/nginx/conf/mime.types"), and default_type - 
but mime.types isn't included.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list