Durgarao
Durgarao

Reputation: 71

Unable to load assets from AWS S3 over https?

AWS S3 Bucket name is stagingfiles.example.com, I am using cloudfront for serving assets.

When site loadded over http, assets(js & css) loaded properly, but when its loaded over https, assets were not loaded. The following error was shown in google chrome web console.

Mixed Content: The page at 'https://staging.example.com/' was loaded over HTTPS, but requested an insecure script 'http://stagingfiles.example.com/assets/home_page-abb03872b937f39d93d8477b6bb80a09.js'. This request has been blocked; the content must be served over HTTPS.

Upvotes: 1

Views: 1729

Answers (1)

Elias5000
Elias5000

Reputation: 116

You need to configure cloudfront to serve assets via https:// as well. Also you need to load assets in your web page via https://. This is not an issue with S3 or cloudfront but a general browser behavior.

BTW: The error message was rather clear about that.

Upvotes: 1

Related Questions