Amazon Web Service with Elastic Load Balancing and Nginx over SSL

I just spent the better part of a day trying to get this working. I was forwarding 443 (HTTPS) from ELB to 443 (HTTPS) that Nginx was listening on.

Everything was working fine except when we tried to do jquery ajax POSTs. The browser would get back a 502 (Bad Gateway) error every time.

We even tried to just have Nginx listen on 80 (HTTP) but the same problem occurred. So our solution.. was to just use TCP forwards for 443 and it started working. Seems ELB messes with the data flowing over it.

So sadly we couldn't use the SSL termination stuff that ELB offers because it broke part of our site.

If there is a solution to this please o please let me know. Otherwise I hope this helps someone to get things working a little quicker than I got it working.