default_type 指令

语 法: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;
    #...
}
说说我的看法
全部评论(
没有评论
关于
本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,请来信告知:hxstrive@outlook.com
公众号