我正在使用this website,当我打开SSL时,标头中的字体已替换为默认字体。我已经阅读了其他主题,还没有找到适合我的解决方案。
CSS
@font-face {
font-family:"icomoon";
src:url("../fonts/icomoon.eot?1cffn0");
src:url("../fonts/icomoon.eot?1cffn0#iefix") format("embedded-opentype"),
url("../fonts/icomoon.ttf?1cffn0") format("truetype"),
url("../fonts/icomoon.woff?1cffn0") format("woff"),
url("../fonts/icomoon.svg?1cffn0#icomoon") format("svg");
font-weight:normal;
font-style:normal;
}
HTML
Nginx服务器
{ listen 443 ssl default_server;
listen [::]:443 ssl;
server_name website.com;
root /home/forge/website.com;
# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/ssl/website-ssl/website.com.chained.crt;
ssl_certificate_key /etc/ssl/website-ssl/website.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA$
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparams.pem;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/website.com/server/*;
client_max_body_size 50M;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
请问有人对此有何解释。
答案 0 :(得分:1)
请检查浏览器控制台是否还有HTTP代替https的第三方URL请求(.css文件)。
示例:
问题: http ://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff
修复程序: https ://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff
答案 1 :(得分:0)
尝试这是您的CSS
@font-face {
font-family:"icomoon";
src:url("https://yourdomain.tld/fonts/icomoon.eot?1cffn0");
src:url("https://yourdomain.tld/fonts/icomoon.eot?1cffn0#iefix") format("embedded-opentype"),
url("https://yourdomain.tld/fonts/icomoon.ttf?1cffn0") format("truetype"),
url("https://yourdomain.tld/fonts/icomoon.woff?1cffn0") format("woff"),
url("https://yourdomain.tld/fonts/icomoon.svg?1cffn0#icomoon") format("svg");
font-weight:normal;
font-style:normal;
}
用您的域名地址替换 https://yourdomain.tld ...