互联网浏览器字体脸ssl [英] internet explorer font face ssl
问题描述
我的网站的字体在使用http的所有浏览器中均能正常工作.但是,当我更改为https时,字体在IE8及更低版本中不起作用,而在ie9中则可以正常工作.
The fonts for my site are working fine in all browsers using http. However when I change to https the fonts don't work in IE8 and below, works correctly in ie9.
使用IE,当我使用http输入.eot文件的路径时,可以选择下载文件,但是当我使用https时,它说找不到.
Using IE, when I type the path to the .eot file using http, I get the option to download the file, but when I use https, it says it can't be found.
我正在使用自分配的证书. iis 7.5 .net 4.0,umbraco 4.7.0 cms,客户端依赖项框架(我尝试过删除客户端依赖项框架,但仍然无法正常工作.)
I'm using a self assigned certificate. iis 7.5 .net 4.0, umbraco 4.7.0 cms, client dependency framework (I have tried with client dependency framework removed, still didn't work).
<style type="text/css">
@font-face {
font-family: 'GGX88UltraLight';
src: url('/css/type/ggx88_ul-webfont.eot');
src: url('/css/type/ggx88_ul-webfont.eot?iefix') format('embedded-opentype'),
url('/css/type/ggx88_ul-webfont.woff') format('woff'),
url('/css/type/ggx88_ul-webfont.ttf') format('truetype'),
url('/css/type/ggx88_ul-webfont.svg#webfontU6kiGgEl') format('svg');
font-weight: normal;
font-style: normal;
}
</style>
可能有用的网络配置值
<staticContent>
<!-- Set expire headers to 30 days for static content-->
<clientCache cacheControlMode="DisableCache" cacheControlMaxAge="30.00:00:00" />
<!-- use utf-8 encoding for anything served text/plain or text/html -->
<remove fileExtension=".css" />
<mimeMap fileExtension=".css" mimeType="text/css; charset=UTF-8" />
<remove fileExtension=".js" />
<mimeMap fileExtension=".js" mimeType="text/javascript; charset=UTF-8" />
<remove fileExtension=".json" />
<mimeMap fileExtension=".json" mimeType="application/json; charset=UTF-8" />
<remove fileExtension=".rss" />
<mimeMap fileExtension=".rss" mimeType="application/rss+xml; charset=UTF-8" />
<remove fileExtension=".html" />
<mimeMap fileExtension=".html" mimeType="text/html; charset=UTF-8" />
<remove fileExtension=".xml" />
<mimeMap fileExtension=".xml" mimeType="application/xml; charset=UTF-8" />
<!-- HTML5 Video mime types-->
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".m4v" mimeType="video/m4v" />
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<!-- Remove default IIS mime type for .eot which is application/octet-stream -->
<remove fileExtension=".eot" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".otf" mimeType="font/otf" />
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
<mimeMap fileExtension=".crx" mimeType="application/x-chrome-extension" />
<mimeMap fileExtension=".xpi" mimeType="application/x-xpinstall" />
<mimeMap fileExtension=".safariextz" mimeType="application/octet-stream" />
</staticContent>
<httpProtocol allowKeepAlive="true">
<customHeaders>
<add name="X-UA-Compatible" value="IE=Edge,chrome=1" />
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
推荐答案
我使用spring-boot遇到相同的行为: 我发现的解决方案是
I faced the same behaviour using spring-boot: the solution I found was to
-隐藏实用程序和Cache-Control返回到浏览器的标头:
Spring-boot正在响应特定的Cache-Control和Pragma HTTP标头.
Spring-boot is responding with specific Cache-Control and Pragma HTTP headers.
Cache-Control :"no-cache, no-store, max-age=0, must-revalidate"
Pragma :"no-cache"
Internet Explorer(在我的情况下为IE11)无法加载带有这些标题的字体. 我相信它是一个错误,我们必须解决它.
Internet explorer (IE11 in my case) is not able to load fonts with those headers. I believe its a bug and we have to cope with it.
使用nginx代理我们的spring-boot应用程序, 我可以克服这个问题, 使用以下nginx配置命令将标题隐藏到浏览器中:
Using nginx to proxy our spring-boot application, I could overcome the problem , hiding that headers to the browser by using the following nginx configuration commands:
server {
listen 443;
server_name server.dns.name;
ssl on;
ssl_certificate /etc/nginx/ssl/server.dns.name.pem;
ssl_certificate_key /etc/nginx/ssl/server.dns.name.key;
location / {
include /etc/nginx/mime.types;
rewrite ^/(.*) /$1 break;
proxy_pass http://127.0.0.1:8080;
proxy_read_timeout 90;
#IE specific tweak for fonts not to be ignored:
proxy_hide_header Cache-Control;
proxy_hide_header Pragma;
#END IE specific tweak for fonts not to be ignored
}
}
这篇关于互联网浏览器字体脸ssl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!