mime sets the Content-Type in a response based on the file extension in the request.
Normally, Content-Type is detected automatically for static files by sniffing the content, but this is not always possible. If you encounter responses with the wrong Content-Type or are serving content other than static files, you can use this middleware to set the right Content-Type.
mime ext type
- ext is the file extension to match, including the dot prefix.
- type is the Content-Type
If you have a lot of MIME types to set, open a block:
Each line defines a MIME extension-type pair. You can have as many lines as you need in a mime block.
Customize the Content-Type of Flash files:
mime .swf application/x-shockwave-flash
For multiple files: