语 法:default_type mime-type;
默认值:default_type text/plain;
上下文:http, server, location
设置默认的响应 MIME 类型,可以使用 types 指令设置文件扩展名到 MIME 类型的映射。
http {
# 引用 mime.types 文件中的 MIME 类型
include mime.types;
# 设置默认的 MIME 类型
default_type application/octet-stream;
#...
}mime.types 文件部分内容如下:
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
#...
}