Nginx配置http块的include和default_type

​ 在配置文件中include是mime.type; default_type是application/octet-stream;按照我滴理解mime.type就是规定浏览器展示内容的类型和对应的后缀。default_type是mime.type的其中一种就是二进制数据流。default_type可以写在http块中,也可写在server块中,也可以写在location块中。

​ default_type用来配置Nginx响应的前端的请求的默认的MIME类型。

语法 default_type mime-type
默认值 default_type text/plain
位置 http\ server\ location

nginx的location中default—type

​ 所以default_type的类型不同,浏览器看到的效果就不同。text/plain是纯文本类型,而text/html 是html类型,application/json是json类型。

text/plain

text/html类型

json类型