6

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;

Adnivas
  • 103
  • 2
  • 7

1 Answers1

8

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.

Richard Smith
  • 45,711
  • 6
  • 82
  • 81