Title: Problem enabling AWS Cloudfront
Last modified: May 6, 2025

---

# Problem enabling AWS Cloudfront

 *  Resolved [gdevelek](https://wordpress.org/support/users/gdevelek/)
 * (@gdevelek)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/problem-enabling-aws-cloudfront-2/)
 * I have enabled it using the W3 Tocal Cache plugin, which happily reports that
   it passes its own built-in testing task. When I open my homepage I do see several
   links that point to my CloudFront distribution. However with F12 on the browser
   several errors appear about CORS when those CloudFront links are opened:
 * `(Reason: CORS request did not succeed). Status code: (null).
   (Reason: CORS header‘
   Access-Control-Allow-Origin’ missing). Status code: 502
 * In the W3 TC settings I have enabled the “Add CORS header” trick, but still it
   does not seem to help any. When I try to access a Cloudfront link with curl, 
   I confirm that the header above is missing.
 * Any clues?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/problem-enabling-aws-cloudfront-2/#post-18452964)
 * Hello [@gdevelek](https://wordpress.org/support/users/gdevelek/)
 * Thank you for reaching out, and I am happy to help!
   You may need to check the
   S3 bucket configuration and check for the CORS rules in AWS to make sure they
   are correctPlease check [this link](https://stackoverflow.com/questions/12358173/correct-s3-cloudfront-cors-configuration)
   for more details and alo check [this video](https://aws.amazon.com/awstv/watch/72b494415bf/)
   for more information, and let me know if this helps!
 * Thanks!
 *  Thread Starter [gdevelek](https://wordpress.org/support/users/gdevelek/)
 * (@gdevelek)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/problem-enabling-aws-cloudfront-2/#post-18453072)
 * Marko, thanks for responding!
 * I’m not sure why you posted the 1st video, I’m not using S3. Am I missing something?
 * I followed the 2nd one, but no success. The “curl” test fails at the end, and
   nothing has been fixed on the browser. I use a URI that is promptly returned 
   when I use the “proper” (non-cloudfront) DNS name in front, let’s call it wp.
   mycompany.com. But with the CF domain it fails with 502 as shown below.
 * I tried both with “legacy cache” and with “cache policy and origin request policy”,
   per the video.
 * I have added my proper DNS as an “alternate domain name” on the AWS, is that 
   correct? And I have not added a CNAME in the W3TC page.
 * > GET /wp-content/themes/twentytwentyfour/assets/fonts/cardo/cardo_normal_400.
   > woff2 HTTP/2
   > Host: dk4l1gj24syd2.cloudfront.netuser-agent: curl/7.68.0accept:_/
   > _origin:wp.mycompany.com
   >  - TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
   >  - Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
   >    < HTTP/2 502
   >  - < content-type: text/html
   >  - < content-length: 507
   >  - < server: CloudFront
   >  - < date: Tue, 06 May 2025 15:26:58 GMT
   >  - < expires: Tue, 06 May 2025 15:26:58 GMT
   >  - < x-cache: Error from cloudfront
   >  - < via: 1.1 2e14fb9d8f93852aec2f703fe567e56c.cloudfront.net (CloudFront)
   >  - < x-amz-cf-pop: ATH50-C1
   >  - < alt-svc: h3=”:443″; ma=86400
   >  - < x-amz-cf-id: J5S20DqQUsq26c4H4s7AM0sGigHRto2GbYAWM2UwaemzyPp29GspJw== 
   >    <
   >    ERROR: The request could not be satisfied
   >  - ERROR Failed to contact the origin.
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/problem-enabling-aws-cloudfront-2/#post-18455095)
 * Hello [@gdevelek](https://wordpress.org/support/users/gdevelek/)
 * Thank you for your feedback.
   Just to confirm, are you usign FSD CDN or asset 
   deliver CDN? What is the CDN type you are using in the General settings and can
   you please sahre the website URL?Thanks!
 *  Thread Starter [gdevelek](https://wordpress.org/support/users/gdevelek/)
 * (@gdevelek)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/problem-enabling-aws-cloudfront-2/#post-18456287)
 * Hello [@vmarko](https://wordpress.org/support/users/vmarko/) ,
 * I don’t know what you mean by “FSD CDN” and “asset deliver CDN”. As mentioned
   I’m trying to enable AWS Cloudfront. The URL is wp-test.fieldcode.com. The Cloudfront
   URL is dklb1gj24syd2.cloudfront.net

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Problem enabling AWS Cloudfront’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [gdevelek](https://wordpress.org/support/users/gdevelek/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/problem-enabling-aws-cloudfront-2/#post-18456287)
 * Status: resolved