amazon-s3http-status-code-403typekit

403 Error in console when trying to load Typekit over S3


Problem

I keep getting one of the following two 403 (Forbidden) errors related to Typekit after uploading my content to Amazon S3. Originally, I thought it might be related to the order of the scripts, but that hasn't seemed to work.

index.html (just the bottom where the scripts are)

<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>

Errors

GET https://use.typekit.net/c/621b04/1w;proxima-nova,2,gbj:W:n3,gbl:W:n4,gbs:W:…6c6c63d47eb6ce1a7c34402d30d0658eb4fd0a4fa5105f68413522cff7d9b48b9c7de0f2f2 

OR

Failed to load resource: the server responded with a status of 403 (Forbidden)

Solution

  • You'll get a 403 error if you don't include the https://s3.amazonaws.com url in your domains you want the fonts to appear on Typekit. Simple fix.

    Kit Settings > Domains > Publish