Challenge - 5 Problems
MIME Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Identify MIME type served by Nginx
Given the following Nginx configuration snippet, what MIME type will Nginx serve for a file named
example.svg?Nginx
types {
text/html html;
image/svg+xml svg;
application/javascript js;
}
location / {
root /var/www/html;
}Attempts:
2 left
💡 Hint
Check the MIME type associated with the .svg extension in the types block.
✗ Incorrect
The configuration maps the .svg extension to the MIME type image/svg+xml, so Nginx will serve example.svg with that MIME type.
❓ Configuration
intermediate2:00remaining
Correct MIME type for JSON files
Which configuration snippet correctly sets the MIME type for files with the
.json extension to application/json in Nginx?Attempts:
2 left
💡 Hint
The MIME type must be application/json and the extension json.
✗ Incorrect
Option A correctly maps the .json extension to application/json. Other options either use wrong MIME types or wrong extensions.
❓ Troubleshoot
advanced2:00remaining
Why is Nginx serving wrong MIME type?
You configured Nginx to serve
.woff2 files with MIME type font/woff2 but browsers still treat them as application/octet-stream. What is the most likely cause?Attempts:
2 left
💡 Hint
Check if the standard MIME types file is loaded by Nginx.
✗ Incorrect
If the mime.types file is not included, Nginx won't know the mapping for .woff2 and will use the default type application/octet-stream.
🔀 Workflow
advanced2:00remaining
Order of MIME type resolution in Nginx
In what order does Nginx determine the MIME type for a requested file?
Attempts:
2 left
💡 Hint
Nginx first looks at local types, then global mime.types, then default.
✗ Incorrect
Nginx first checks the types defined in the current context, then the global mime.types file, and finally falls back to default_type if no match is found.
✅ Best Practice
expert3:00remaining
Best practice for custom MIME types in Nginx
What is the best practice to add a custom MIME type for a new file extension
.abc without modifying the default mime.types file?Attempts:
2 left
💡 Hint
Avoid editing default files; use includes for customizations.
✗ Incorrect
Best practice is to create a separate file with custom MIME types and include it in the main config. This keeps default files intact and makes upgrades easier.