Recall & Review
beginner
What is a MIME type in the context of web servers like nginx?
A MIME type tells the browser what kind of file it is receiving, such as text, image, or video, so the browser knows how to handle or display it.
Click to reveal answer
beginner
Where does nginx typically store MIME type configurations?
In the file usually named
mime.types, which is included in the main nginx configuration file.Click to reveal answer
beginner
How do you include MIME types in the nginx configuration?
By using the directive
include mime.types; inside the http block of the nginx config file.Click to reveal answer
intermediate
What is the purpose of the
default_type directive in nginx?It sets the MIME type to use when a file's type is not found in the MIME types list, often set to
application/octet-stream.Click to reveal answer
intermediate
How would you add a custom MIME type for files with extension
.abc in nginx?Add a line like
application/x-abc abc; inside the types block in the mime.types file or directly in the nginx config.Click to reveal answer
What does the MIME type
text/html tell the browser?✗ Incorrect
The MIME type
text/html means the file is an HTML document for web pages.Where do you include the MIME types file in nginx configuration?
✗ Incorrect
The
include mime.types; directive is placed inside the http block.What happens if nginx cannot find a MIME type for a file?
✗ Incorrect
Nginx uses the
default_type directive to assign a MIME type when none matches.How do you define a new MIME type for extension
.xyz?✗ Incorrect
You add the new MIME type mapping inside the
types block.What file extension is commonly associated with the MIME type
image/png?✗ Incorrect
The
image/png MIME type is for files ending with .png.Explain how nginx uses MIME types to serve files correctly to browsers.
Think about how nginx tells the browser what kind of file it is sending.
You got /4 concepts.
Describe the steps to add a custom MIME type for a new file extension in nginx.
Focus on where and how to add the new MIME type mapping.
You got /4 concepts.