1

I have a question regarding a redirect (302) that happens when accessing the /admin panel of my Craft CMS application.

I've setup CloudFront for my app that runs on Craft 3. DNS points to CF (CNAME), CF has Elastic Load Balancer (ELB) as a default origin. The ELB is a subdomain on my main domain (for certificates reasons). There is a CNAME set for ELB on the main domain DNS.

Now, when I'm visiting any page on my application, there is no redirection happening (eg. when I go to www.myapp.com/product). Only when I'm visiting the /admin panel, I get redirected to the ELB domain. Eg. I go to www.myapp.com/admin and I get redirected to www.elb-domain.awsloadbalancerdomain.com (ELB's CNAME).

Any of you has any ideas about why this might be happening and how to prevent it?

Thank you in advance!

2 Answers2

1

As the issue is happening only with /admin URL, this might be related with cookies which are being passed to the backend application's /admin URL.

You may need to check with CraftCMS team (or some other forums) and get the list of cookies which are being used by the /admin URL. You can whitelist those cookies in cloudfront specifically for /admin URL.

Samit
  • 1,021
  • 6
  • 11
1

I needed to whitelist Host, Origin and Referer in the Whitelist Headers section.

I've had more issues with CloudFront, wrote a blog post about it, maybe someone will find it helpful: https://medium.com/@justynazet/placing-a-craft-cms-application-behind-the-cloudfront-1602027ff72b