mimetypes for .svg, .woff and .eot not working in Azure

I've added mimetypes to web.config for .svg, .woff and .eot and they are not getting picked up Here's a repro deployed to cloud:.

 

http://mimetypetest.cloudapp.net/font.aspx

The font.aspx page will not pick up the .woff font and will display as the backup font ie9. But if you run the Web project (out of cassini) the font.aspx page will display the Felbridge font in ie9. 

 

 

I have the following in my web.config:

 

  <system.webServer>

    <modules runAllManagedModulesForAllRequests="true"/>

    <staticContent>

      <remove fileExtension=".svg" />

      <remove fileExtension=".eot" />

      <remove fileExtension=".woff" />

      <mimeMap fileExtension=".svg" mimeType="image/svg+xml"  />

      <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />

      <mimeMap fileExtension=".woff" mimeType="application/x-woff" />

    </staticContent>

  </system.webServer>

 

What’s the story here?

 

Karsten

August 18th, 2010 5:01pm

Well, there is a workaround, which is to put those files in blob storage and set the mimetype there. However, it would be nice to understand why you can't set mimetypes via system.webServer in your web role.
Free Windows Admin Tool Kit Click here and download it now
August 18th, 2010 9:34pm

Hi Karsten,

I tested your webpage at http://mimetypetest.cloudapp.net/font.aspx

By using Fildder, I noticed that it return 404 "File not found" error for request to FelbridgeOTS-Condensed.woff file. I suggest you checking your project, please make sure setting FelbridgeOTS-Condensed.woff build action to "Content" and "CopyIfNewer".

Thanks,

August 19th, 2010 5:44am

Hi Mog - The problem is that the file is there (I have the settings right in VS) but the mimetype from web.config isn't being picked up and IIS is returning a 404.  I can even get a better repro on my local box, in which it returns a 404.3, so it knows that the file is there, but it just won't serve it. Why won't Azure pick up mimetypes set in web.config?

 

Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2010 5:52pm

Hi,

You may have checked this already, but I can't make it out of your question. Do you have the IIS -> WWW-Services -> Common HTTP Features -> Static Content feature checked?

August 23rd, 2010 6:27pm

Hi Patriek - Thanks for the response. Yes, on my dev box, I do have that feature checked.
Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2010 9:46pm

Just a quick note, SVG does seem to be working. Woff is not. Like you noted, it works if you copy it to storage and set the right mime type there.
September 7th, 2010 11:41pm

Hi, did you resolved this annoyed problem? If you have good solution, could you teach me how to do this?
Free Windows Admin Tool Kit Click here and download it now
September 21st, 2010 3:07am

The storage issue actually didn't work out for me in production because the domain names don't match (in testing this worked because everything was running from my local IP).  The client request from the site hosted on an azure compute node to the woff file on the azure storage node is always aborted by the browser due to cross-domain restrictions.

 

One workaround which works in production is to put everything (aspx, html, css, and the woff file) on the azure compute node.  You need to rename the woff file to a .zip file so that the compute node will serve it.  Then you need to change the path to the woff file accordingly in the css file.  The browser still reads the font even though the file extension is a .zip, this just lets the azure compute node serve it.

 

 

September 27th, 2010 2:56pm

I had the same problem

The problem is not Azure, but Visual Studio. If you look to the properties of the .woff file, you will see that the "build action" is set to "none" after importing the .woff and .eot files. Set the build action to "content", and you will see your html5 fonts on azure :)

 

 

 

Free Windows Admin Tool Kit Click here and download it now
February 21st, 2011 9:12am

I had the same problem

The problem is not Azure, but Visual Studio. If you look to the properties of the .woff file, you will see that the "build action" is set to "none" after importing the .woff and .eot files. Set the build action to "content", and you will see your html5 fonts on azure :)

 

 

October 3rd, 2011 1:45pm

Hi PurePlexity.

That was it! Thanks.

Free Windows Admin Tool Kit Click here and download it now
October 24th, 2011 4:31pm

I did all of these things, but still not work.

"NetworkError: 404 Not Found - http://***.azurewebsites.net/Content/fonts/a.otf"

Do you have any idea how can I fix it?

Thx

August 6th, 2015 5:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics