被微软的 cdn 给坑了

2015-10-23 19:08:10 +08:00
 pc10201
想着微软跟中国政府关系还行,不像 google 的 cdn 容易被墙,就用了它的 cdn
主要是 bootstrap 的库,没想到

Font from origin 'http://ajax.aspnetcdn.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access.
8676 次点击
所在节点    程序员
26 条回复
guoyijun163
2015-10-24 12:22:59 +08:00
@Showfom 更具体的 log ,带 IP ,还有同节点其他 IP 也是这样

root@iZ23rk476waZ:~# curl -I https://cdn.css.net/fonts/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1-gdm0LZdjqr5-oayXSOefg.woff2 -v
* Hostname was NOT found in DNS cache
* Trying 61.164.125.164...
* Connected to cdn.css.net (61.164.125.164) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
* subject: OU=Domain Control Validated; CN=*.css.net
* start date: 2015-07-30 09:05:49 GMT
* expire date: 2016-07-30 09:05:49 GMT
* subjectAltName: cdn.css.net matched
* issuer: C=BE; O=GlobalSign nv-sa; CN=AlphaSSL CA - SHA256 - G2
* SSL certificate verify ok.
> HEAD /fonts/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1-gdm0LZdjqr5-oayXSOefg.woff2 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: cdn.css.net
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Sat, 24 Oct 2015 04:23:07 GMT
Date: Sat, 24 Oct 2015 04:23:07 GMT
< Content-Type: font/woff2
Content-Type: font/woff2
< Content-Length: 15676
Content-Length: 15676
< Connection: keep-alive
Connection: keep-alive
< Last-Modified: Thu, 28 Aug 2014 18:20:07 GMT
Last-Modified: Thu, 28 Aug 2014 18:20:07 GMT
< Expires: Thu, 31 Dec 2037 23:55:55 GMT
Expires: Thu, 31 Dec 2037 23:55:55 GMT
< Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
< Timing-Allow-Origin: *
Timing-Allow-Origin: *
< X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
X-XSS-Protection: 1; mode=block
< Cache-Control: max-age=315360000
Cache-Control: max-age=315360000
< Alternate-Protocol: 443:quic,p=1
Alternate-Protocol: 443:quic,p=1
< Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
< Age: 2414294
Age: 2414294
< Via: http/1.1 EACNCTCZJZWZZ01C001 (ATS [cRs f ])
Via: http/1.1 EACNCTCZJZWZZ01C001 (ATS [cRs f ])
< Domain-Id: f7d89368ba9fb1de62db1c
Domain-Id: f7d89368ba9fb1de62db1c

<
* Connection #0 to host cdn.css.net left intact
Showfom
2015-10-24 14:13:33 +08:00
@guoyijun163 CDN 的坑 233333 看来得自建了
guoyijun163
2015-10-24 14:26:18 +08:00
@Showfom -_-搞的我心情大好的把 wordpress 引用全改了,结果发现全部引用不生效……还好 font 影响不大
bdbai
2015-10-24 14:55:33 +08:00
这个老坑了,推荐 bootcss 的 cdn 。
Showfom
2015-10-24 16:50:46 +08:00
@guoyijun163 我这访问的节点没问题 日了狗了
guoyijun163
2015-10-24 22:28:18 +08:00
@Showfom 我是访问的节点里一些有问题一些没问题……所以搞的一会字体出来一会没字体……醉了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/230562

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX