Azure CDN is not serving my .html properly

独自空忆成欢 提交于 2019-12-24 11:54:49

问题


I have setup some static content in a CDN but when accessing the .html file, the file gets downloaded and not rendered in the browser.

I am using a blob container

http://cdn-dezelo-consulting01.azureedge.net/index.html

I don't know what I missed ?


回答1:


I traced the request/response through Fiddler and noticed the Content-Type property on your blob (index.html) is set as application/octet-stream (which is default content type for a blob in Azure). This is the reason it is being downloaded instead of displayed in the browser because the browser doesn't know how to deal with this type of content.

Please change the content type property of the blob to text/html and the HTML page should load just fine.

As a side note, try accessing the URL in Internet Explorer and it should work (In my experience I have found IE to be a bit smarter than other browsers :). While other browsers rely on content type property, IE seems to infer the file type rather smartly).



来源:https://stackoverflow.com/questions/34409768/azure-cdn-is-not-serving-my-html-properly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!