Hello @rashidavc18
Thank you for reaching out and I am happy to help!
The 403 Forbidden error is an HTTP status code that indicates the server is denying access to the requested resource
1. CloudFront Distribution Configuration
One of the most common causes of a 403 Forbidden error on CloudFront is an incorrect distribution configuration. This can occur if the distribution is not configured correctly, or if there are errors in the configuration. Specifically, you should check the following configuration settings:
- Origin Domain Name: Ensure that the origin domain name is correct, and that the origin is accessible from CloudFront.
- Origin Protocol Policy: Check that the origin protocol policy is set to the appropriate setting (HTTP, HTTPS, or match viewer).
- Cache Behavior Settings: Verify that the cache behavior settings are correct and that they allow access to the requested resource.
2. CORS Configuration
Another common cause of a 403 Forbidden error on CloudFront is an incorrect Cross-Origin Resource Sharing (CORS) configuration. This can occur if the CORS configuration is incomplete, incorrect, or missing altogether. Specifically, you should check the following configuration settings:
- Allowed Origins: Ensure that the allowed origins are set correctly and that they include the domain from which you are accessing the resource.
- Allowed Methods: Check that the allowed methods (e.g., GET, POST) are set appropriately for the requested resource.
- Allowed Headers: Verify that the allowed headers are set correctly and that they include any headers required by the resource
This is not specifically related to the W3 Total Cache since only specific files are blocked.
If this does not help, please try to exclude those files from the CDN
AWS is a pain sometimes, and I would reccomend BunnyCDN over Cloudfront every day!
Thanks!