Skip to content

ECS Breaking my site

0

Enter image description here Everything works in docker and locally, but when i push my container and run on ECS I get this overlapping duplicate site page thing

I have had no change in my code base, which makes me think its an issue with aws itself.

any help to fix this would be very appreciated

  • Can you share url?

  • https://booksummariesandsparknotes.com/

    I have also reverted back to a basic template website and pushed it to ecr/ecs. It had been functioning properly a few months ago and never had an issue. I utilized the same variables as my Terraform scripts. I even modified the names of the Terraform variables, suspecting that duplicated resources might be causing problems. However, this did not resolve the issue; the problem persists. could it be something to do with me using fargate?

asked 2 years ago395 views
3 Answers
1
Accepted Answer

Looking at the Console output on Chrome Inspect action (check below), I could see that the CSS files are not loading due to use HTTP instead of HTTPS. There are some other elements with the same problem.

This could explain why you are being able to run it locally. Most likely that you are using HTTP locally and HTTPS while hosting on ECS.

booksummariesandsparknotes.com/:20 Mixed Content: The page at 'https://booksummariesandsparknotes.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://booksummariesandsparknotes.com/static/css/mystyle.css'. This request has been blocked; the content must be served over HTTPS.

AWS
EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
  • brilliant, that was it! swapped it over to https, works like a charm

1

Hi.I don't think AWS is the cause because the behavior of the application on the container is within the responsibility of the user. Is it possible that the container is changing the behavior in the application depending on the environment variables it is reading? Or is the browser the same as the browser viewed locally?

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
  • it is strange because i checked out a commit that was from weeks ago which was working perfectly, i build and pushed that to ecs in teh same way, and i have the same problem. the browser locally is the same. i'm useing chrome. When i launch locally to my browser by launching the docker container there is no issue

  • As _takahash said, running it on ECS will not break the website content. Please check Chrome's Developer Tools for errors. You should be able to see other ECS access logs, etc., so please check them. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/logs.html

0

Seems like a absolute vs relative URL path problem.

AWS
EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
  • are you able to expand on this please?

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.