default_type应用程序/nginx.conf文件中的Octet-stream
在默认的nginx配置文件中,我看到default_type设置为应用程序/octet-stream。我了解哑剧类型,但我不明白为什么我们要设置默认类型。这种配置的意义是什么?有人可以帮我理解吗?
包括/etc/nginx/mime.types; default_type应用程序/八位字节;
In the default nginx configuration file i see that the default_type is set to application/octet-stream. I understand the MIME types but I do not understand why we are setting a default type. What is the significance of this configuraion? Can someone help me to understand this?
include /etc/nginx/mime.types;
default_type application/octet-stream;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
default_type
仅适用于mime.types
file中尚未定义的文件扩展名。如果从
mime.types
文件中缺少文件扩展名,则假设application/ocket-stream
相当安全,大多数浏览器都会将其视为二进制文件并下载它而不是试图渲染它。mime.types
文件只是types
指令,其中包含一长串常见的MIME类型及其关联的文件扩展名。参见此文档有关详细信息。
The
default_type
only applies to file extensions that have not been defined in themime.types
file.If the file extension is missing from the
mime.types
file, it's fairly safe to assumeapplication/octet-stream
, which most browsers will treat as a binary file and download it rather than attempting to render it.The
mime.types
file is simply atypes
directive with a long list of common MIME types and their associated file extension(s).See this document for details.