For a while now, I have an AWS Amplify app running on a specified domain: https://mydomain.io
. Recently, I created an ECS task running a Python Flask (at port 8080) and Postgres container. The instance runs via Fargate with Load Balancer with a valid SSL cert. App works perfectly on HTTP where I can run access it via http://my-public-ip.us-east-2.compute.amazonaws.com:8080/myapp
. All AWS consoles show green, healthy, or running statuses.
However, I cannot get the HTTPS to render at https://www.mydomain.io/myapp
. Weirdly, this page redirects with 304 to home page, https://www.mydomain.io
, but all content is messed up, rendering 404 error on all assets (CSS, JS, etc.). Is ALB port-forwarding being interrupted by Amplify redirection? I removed all user rewrites in Amplify to no avail. And Amplify still adds a trailing slash to URL: https://www.mydomain.io/myapp/
. I read and applied the following solutions to no avail, possibly because OPs use cases slightly differ from my own?
-
Map same domain to two different AWS resources
-
Prevent AWS Amplify From Adding Trailing Slash and Forcing Redirect
-
AWS Amplify use ssl certificate in spring boot backend for https
Below are any pertinent details and lingering questions:
Load Balancer (listens for two ports)
Do I need to add listener for 80? If so, will it affect the Amplify site?
Target Group (forwarded from above HTTPS)
Do I need another target group for port 80?
CloudFront (attempt from first linked SO question)
Does this distribution need a new record in hosted zone of Route53? Redacted screenshot below would by /myapp
.