2

I have an IIS web server behind a ELB. The web server uses security cookie to keep user signed in during the session. I have CloudFront for the purpose of redirecting HTTP to HTTPS.

If I directly access the ELB using its own DNS name, everything works fine. But if I access the CloudFront using "www.eyecloud.net.au", after I sign in, it keeps bouncing me back to the login page.

It is my first time using CloudFront. What went wrong?

enter image description here

2
  • Did you configure the Cache Behavior to forward cookies to the origin? By default, they are not forwarded. Oct 12, 2017 at 3:59
  • Why do you need HTTPS for internal communication between the ELB and the IIS server? If you have everything within a VPC and properly configured subnets I see no need for that. In my opinion you would need a quite specific requirement or use case to motivate that.
    – Bazze
    Oct 12, 2017 at 20:05

1 Answer 1

2

Configure CloudFront to forward cookies to your origin server. You may want to use a whitelist of cookies to forward.

Also, using CloudFront just to do http to https forwarding seems excessive. Surely IIS can do that trivial task. This page says it can.

2
  • Thank you for your reply Tim. Yes IIS can do HTTP to HTTPS redirect, but when IIS is behind an ELB, the ELB can only talk to IIS in one single protocol, so you have to let ELB talk to IIS in HTTPS. Then IIS will never need to do the redirect. And, ELB itself can't do redirect. So CloudFront seems to be the only option...
    – AussieDude
    Oct 12, 2017 at 4:50
  • Solution to that can be found here.
    – Tim
    Oct 12, 2017 at 7:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .