Support » Plugin: W3 Total Cache » 403 errors on some files served by CDN

  • Resolved Megunticook

    (@megunticook)


    I’ve got W3TC set up with CDN set to Amazon CloudFront over S3 (origin push).

    Overall seems to be working, but I’m seeing a number of 403 errors when I inspect the site with the Developer Tools console. All of the URLs that have 403 errors are in the /wp-content/plugins/ directory.

    Here’s what I get when I load the home page at https://swansislandcompany.com:

    GET https://cdn.swansislandcompany.com/wp-content/plugins/wordfence/css/wordfenceBox.1563297204.css.gzip net::ERR_ABORTED 403
    (index):147 GET https://cdn.swansislandcompany.com/wp-content/plugins/wordpress-seo/css/dist/adminbar-1160.min.css.gzip net::ERR_ABORTED 403
    (index):89 GET https://cdn.swansislandcompany.com/wp-content/plugins/woocommerce-composite-products/assets/css/frontend/woocommerce.css.gzip net::ERR_ABORTED 403
    jquery-migrate.min.js.gzip:2 JQMIGRATE: Migrate is installed, version 1.4.1
    (index):159 GET https://cdn.swansislandcompany.com/wp-content/plugins/wordfence/js/admin.ajaxWatcher.1563297204.js.gzip net::ERR_ABORTED 403
    (index):4299 GET https://cdn.swansislandcompany.com/wp-content/plugins/easy-login-woocommerce-premium/assets/fonts/Easy-Login.ttf?oy4gsz net::ERR_ABORTED 403
    jquery.js.gzip:2 GET https://cdn.swansislandcompany.com/wp-content/plugins/popup-maker//assets/images/admin/icon-info-21x21.png 403
    (anonymous) @ jquery.js.gzip:2
    i @ jquery.js.gzip:2
    fireWith @ jquery.js.gzip:2
    ready @ jquery.js.gzip:2
    J @ jquery.js.gzip:2
    (index):1 GET https://cdn.swansislandcompany.com/wp-content/plugins/easy-login-woocommerce-premium/assets/fonts/Easy-Login.woff?oy4gsz net::ERR_ABORTED 403

    After doing some research, I tried setting a bucket policy that would give everyone read access to that path:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "AddPerm",
                "Effect": "Allow",
                "Principal": "*",
                "Action": [
                    "s3:GetObject"
                ],
                "Resource": [
                    "arn:aws:s3:::sico-production-static-content/wp-content/"
                ]
            }
        ]
    }

    But even after I set that policy, I’m still getting those 403 errors.

    What’s going on here? How do I fix this? I’m not seeing any visible problems on my site, but why are those files forbidden?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Quick follow up: I looked for some of those specific files that were giving 403 errors in S3 and couldn’t find the first one I looked for…so I had W3TC re-upload all those files. A bunch of the 403 errors disappeared, so I guess maybe there were some updates on the local server that diidn’t make it to the CDN? But why wouldn’t it have just given a “file not found” error instead of a 403?

    Still getting 403 on these files though:

    GET https://cdn.swansislandcompany.com/wp-content/plugins/easy-login-woocommerce-premium/assets/fonts/Easy-Login.ttf?oy4gsz net::ERR_ABORTED 403
    (index):4365 GET https://cdn.swansislandcompany.com/wp-content/plugins/easy-login-woocommerce-premium/assets/fonts/Easy-Login.woff?oy4gsz net::ERR_ABORTED 403
    jquery.js.gzip:2 GET https://cdn.swansislandcompany.com/wp-content/plugins/popup-maker//assets/images/admin/icon-info-21x21.png 403
    (anonymous) @ jquery.js.gzip:2
    i @ jquery.js.gzip:2
    fireWith @ jquery.js.gzip:2
    ready @ jquery.js.gzip:2
    J @ jquery.js.gzip:2
    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @megunticook,

    I am sorry to hear about your issue. I am happy to assist you with this.
    Please check the link below for clarification
    https://stackoverflow.com/questions/19037664/how-do-i-have-an-s3-bucket-return-404-instead-of-403-for-a-key-that-does-not-e

    I hope this helps.

    Thanks, I’ll have a look at that.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    No activity for a week. Marking topic as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.