I am looking to setup an ELB that uses HTTPS to communicate with backend servers. I am trying to setup a proof of concept using a single backend server, but can't seem to get the ELB to communicate with server. I am almost certain this is a certificate issue since any setup without SSL works perfectly.
How can I set this up? I have tried various suggestions from multiple answers and blog posts, but no luck.
What I am doing now is setting a self-signed certificate using the following commands (from AWS ELB -> Backend Server over HTTPS with Self-Signed Certificate):
$ openssl genrsa \
-out /path/to/ssl.key 2048
$ openssl req \
-sha256 \
-new \
-key /path/to/ssl.key \
-out /path/to/ssl.csr
$ openssl x509 \
-req \
-days 365 \
-in /path/to/ssl.csr \
-signkey /path/to/ssl.key \
-out /path/to/ssl.crt
I have tried multiple domain names, when signing, and I can curl using them:
curl https://[Public DNS, or private DNS or IP used to create the SSL crt]/status --cacert /path/to/ssl.crt
Is there a domain/IP/DNS entry I should use here? I feel pretty good that curl works at least.
Currently my Nginx config (in a site-enabled file) looks like this:
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /path/to/ssl.crt;
ssl_certificate_key /path/to/ssl.key;
server_name <dummy value of "_" or name used to make SSL certs>;
client_max_body_size 20M;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
This works with the curl command above.
I have tried classic and application load balancers. With classic, I have tried adding the ssl.crt contents - I do not see a similar option with the application load balancers, though I would like to use them if possible because they can forward HTTP->HTTPS really easily. Either way, neither the classic or application load balancer is communicating with the server.
Any suggestions for what is missing? Or how to determine what is missing?