尝试通过 S3 加载 Typekit 时控制台出现 403 错误
403 Error in console when trying to load Typekit over S3
问题
将我的内容上传到 Amazon S3 后,我不断收到与 Typekit 相关的以下两个 403(禁止)错误之一。本来以为是跟脚本的顺序有关,结果好像不行。
index.html(脚本所在的底部)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/scripts.js"></script>
<!-- Typekit -->
<script src="https://use.typekit.net/nig8pij.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-65254339-3', 'auto');
ga('send', 'pageview');
</script>
错误
GET https://use.typekit.net/c/621b04/1w;proxima-nova,2,gbj:W:n3,gbl:W:n4,gbs:W:…6c6c63d47eb6ce1a7c34402d30d0658eb4fd0a4fa5105f68413522cff7d9b48b9c7de0f2f2
或
Failed to load resource: the server responded with a status of 403 (Forbidden)
如果您不在您的域中包含 https://s3.amazonaws.com
url 您希望字体出现在 Typekit 上,您将收到 403 错误。简单修复。
Kit Settings > Domains > Publish
问题
将我的内容上传到 Amazon S3 后,我不断收到与 Typekit 相关的以下两个 403(禁止)错误之一。本来以为是跟脚本的顺序有关,结果好像不行。
index.html(脚本所在的底部)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/scripts.js"></script>
<!-- Typekit -->
<script src="https://use.typekit.net/nig8pij.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-65254339-3', 'auto');
ga('send', 'pageview');
</script>
错误
GET https://use.typekit.net/c/621b04/1w;proxima-nova,2,gbj:W:n3,gbl:W:n4,gbs:W:…6c6c63d47eb6ce1a7c34402d30d0658eb4fd0a4fa5105f68413522cff7d9b48b9c7de0f2f2
或
Failed to load resource: the server responded with a status of 403 (Forbidden)
如果您不在您的域中包含 https://s3.amazonaws.com
url 您希望字体出现在 Typekit 上,您将收到 403 错误。简单修复。
Kit Settings > Domains > Publish