CloudFront Issue: Not rendering Static Website properly

0

Hi There, I'm having issue with my Static Website page hosted on S3, assuming it is my CSS style sheets aren't rendering on CloudFront.

Basically when I use my CloudFront link - https://xxxxxxxxx.cloudfront.net, my website it not rendering properly, therefore unable to use Cloudfront now.

Can anyone please help in determining why CloudFront won't render my static website properly?

Thank you so much!

C-style
asked 8 months ago781 views
3 Answers
1

Hello.
Can you check your browser's developer tools, etc. to see what errors you are seeing when loading CSS?
https://support.google.com/campaignmanager/answer/2828688?hl=en

profile picture
EXPERT
answered 8 months ago
  • Error Message from chrome dev tools:

    Even though the initial HTML page is loaded over a secure HTTPS connection, some resources like images, stylesheets or scripts are being accessed over an insecure HTTP connection. Usage of insecure resources is restricted to strengthen the security of your entire site.

    This is the first error of the 44 errors:

    insecure stylesheet 'search.min.css'. This request has been blocked; the content must be served over HTTPS. (index):4

    How can I correct Cloudfront to fix this behavior?

    Thank you!

  • How is the CloudFront distribution configured? Is the system configured to redirect to HTTPS when access occurs over HTTP? If you select "Redirect HTTP to HTTPS" in the settings in the following document, HTTP accesses will be redirected to HTTPS. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html

  • Correct, this is the setting I have: Redirect HTTP to HTTPS

    Why is it still happening then?

  • I have tried all the other settings in CloudFront over the last few weeks, however I always get the same results. I'm really puzzled as to why this is always the same result. I really need to have CloudFront work as it is used with many of the other AWS tools (which this is a roadblock for many), I'm at a loss, please help if you know how I can get it to work. Thank you!

  • I can't tell without looking at the source code, but is there anything that states to use HTTP to access the CSS?

0
Accepted Answer

I figured this out. It was the way I was uploading my website pages that included the incorrect paths from within the website HTTP. I chose a different path option and update all my URL paths that link between the pages, then Cloudfront was able to accept the HTTPS conversion from HTTP. Thank you for the advise on checking the my website source code pages I was creating and uploading as that was the issue.

C-style
answered 8 months ago
profile picture
EXPERT
reviewed 7 months ago
0

Not sure I understand the question. You need the source code for the website index.html page? Or source code from the chrome developer showing errors? Let me know and I can post it here?

I also tried updating/changed all the html source code from HTTP to HTTPS on the index page, but that didn’t work because then the website would not load at all with the spinning wheel.

Since this has been an ongoing issue with CloudFront and all I want is to secure my site with HTTPS, I am looking to move everything over to another hosting like blue host or CloudFare so I can accomplish getting my site to be HTTPS.

C-style
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions