After setting up Elastic Load balancer my https doesn't work anymore. Nginx error
Ended up getting the answer from vandemar in the nginx IRC Channel. Seems pretty simple, but I struggled with figuring it out. The ELB was handling the SSL, I had already given it all the cert information. The problem was trying to handle it again on the individual instances or in the configuration file. The solution is to just eliminate all the SSL stuff from the config file. So removing these three lines fixed everything:
ssl on;
ssl_certificate ssl.crt;
ssl_certificate_key ssl.key;
For me, I was using CloudFormation to set up my load balancer. InstanceProtocol
defaults to HTTP, and I didn't have that parameter set. This was the fix:
ElasticLoadBalancer:
Type: 'AWS::ElasticLoadBalancing::LoadBalancer'
Properties:
Listeners:
- LoadBalancerPort: '443'
Protocol: HTTPS
InstancePort: '443'
InstanceProtocol: HTTPS