2

When I setup the LBS on the aws, I set SSL offload to forward requests from port 443 on ELB to port 80 on the EC2 instances.

I am not sure this is right or not since I saw many people did that. But after I did that I got lots of errors within the browser console:

"This request has been blocked; the content must be served over HTTPS."

Should I change the forward port 80 to 443? and install ssl for each instance?

jack x
  • 23
  • 3

1 Answers1

1

443 to 80 is correct. Your EC2 instance serves plain data, the ELB encrypts it before sending it out of AWS.

There are a few nuances to this- the server thinks it is serving plain content on 80, so if it creates URLs they will typically be http:// without some configuration. (it depends on your framework, server, etc)

The second nuance is that hardcoded URLs will break it in a similar manner. That error message has been explained in a stackoverflow question about Ajax, some form of that is causing your problem.

Community
  • 1
  • 1
tedder42
  • 23,519
  • 13
  • 86
  • 102
  • Thanks for you answer. I found the reason why it did not work. It is not because I hard code http:// in any ajax call, it is because the header has one "base' element which always use [http://something](http://something) – jack x Mar 22 '15 at 14:38
  • 1
    That's what I said in the second paragraph. – tedder42 Mar 22 '15 at 16:26
  • @jackx I am having an exact same issue. Are you referring to META base tag in HTML header? Because mine says (notice HTTPS) but the AJAX still redirects to HTTP. I totally see that ELB redirects from HTTPS to HTTP but can't figure out a way to work around this. I was also looking at deploying SSL on EC2 instances and changing to 443 ->443 redirect instead of 443->80. – Insider Pro May 17 '16 at 05:51