After 12 hours, I could not make HTTPS work in my application. I did:
- In Amazon Certificate Manager, I created a certificate for my domain;
- In Security Groups - Inbound Tab, I included the HTTPS (HTTPS - TCP - 443 - 0.0.0.0/0)
I created a Classic Load Balancer and included 2 listners:
- HTTP - Port 80
- HTTPS - Port 443 | Instance Protocol HTTP | INSTANCE PORT 80 | Associate my certificate (step 1 - ACM Amazon Certificate Manger)
In Amazon Route 53 - Hosted Zones, I added 2 records in my hosted zone:
- CNAME www with value mydomain.com
- Type A IPv4 Address | Alias YES | Alias Target: My Load Balancer
In tutorials I saw (youtube + internet), only with the steps above the HTTPS works on Amazon EC2. But, the tutorials is not for NGINX and Ruby On Rails.
The error I get is: ERR_CONNECTION_REFUSED
After more search:
- Using ssh, I went to: /etc/nginx/sites-available/myapp and I removed the comment: listen 443 ssl;
After restart nginx, I got 2 random errors: ERR_CONNECTION_RESET and ERR_CONNECTION_CLOSE
I don't know more what to do.
Some prints:
/etc/nginx/sites-available/myapp

My Environment
OS: Ubuntu 14.04.2 LTS
ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
rails -v: Rails 4.2.3
nginx -v: nginx/1.8.0
Tks everyone!



