default_type application/octet-stream in nginx.conf file
Asked Answered
M

1

7

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;

Markova answered 15/4, 2022 at 4:20 Comment(0)
G
10

The default_type only applies to file extensions that have not been defined in the mime.types file.

If the file extension is missing from the mime.types file, it's fairly safe to assume application/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 a types directive with a long list of common MIME types and their associated file extension(s).

See this document for details.

Gladdy answered 15/4, 2022 at 7:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.