Serving fonts with correct mime types

Update: This was added in nginx 1.3 officially. You may still use this article if mime.types file is not uptodate on your nginx-server.

On a nginx site, for font files, especially woff version, we ran into issues.

Browser console was showing warnings like:

Resource interpreted as Font but transferred with MIME type font/x-woff
Resource interpreted as Font but transferred with MIME type font/font-woff

Solution

Open /etc/nginx/mime.types

Add following lines in it:

application/font-woff           woff; 
application/x-font-woff         woff;

Save file.

Reload nginx. (service nginx reload)

Discuss your project
with our experts

No obligation. Limited slots.

Contact Form Business Enquiry

"*" indicates required fields

Please attach any RFP, project specification, or document that you would like to share.
Drop files here or
Max. file size: 5 GB.
    This field is for validation purposes and should be left unchanged.