简体   繁体   中英

How to redirect https to https with www using AWS application load balancer?

Can anyone please help me to figure out redirection issue with AWS application load balancer?

I have -

  • Deployed React JS app on EC2 - Ubuntu 18.04 with Nginx
  • Obtained SSL from AWS ACM
  • Attached ALB to EC2 instance, added 2 listeners - PORT 80, PORT 443 (Forwarding request to target group on PORT 80)
  • added CNAME record www pointing to ALB

Also, I have added redirect rule in listener 443 as -

在此处输入图像描述

But when I am visiting my site like - https://exampledomain.ai it throws DNS_PROBE_FINISHED_NXDOMAIN

Update: When I visit -

mydomain.ai //redirected to https://www.mydomain.ai
http://mydomain.ai //redirected to https://www.mydomain.ai
http://www.mydomain.ai //redirected to https://www.mydomain.ai

Is there anything else I am missing? Please help

  1. Create redirection rule on port 80在此处输入图像描述

2. Go to route 53 and create a new cname with example.com and point to the same ALB.

Now it will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM