title: Elastic Beanstalk Single Instance SSL .ebextensions config file not working
body: <p>I was trying to use SSL on my single instance. I think I managed to generate the key and certificate correctly, and after some poking around I managed to locate the instructions for configuring the instance to use it. </p>
  
  <p>So I created an .ebextensions folder in the top level directory and inside I have a file I named singlessl.config</p>
  
  <p>I have included the file below exactly as I have uploaded it. It's not working, does anyone know what the error could be?</p>
  
  <p>(At least something happened though, because now I am getting an "unable to connect" message)</p>
  
  <p>Anyhow I have replaced some strings like the key with other chars but other than that it's exactly the same</p>
  
  <p>The environment is a single instance Node.js with no load balancer and here is the file:</p>
  
  <pre><code>Resources:
      sslSecurityGroupIngress: 
          Type: AWS::EC2::SecurityGroupIngress
          Properties:
              GroupName: {Ref : awseb-e-10randchar-stack-AWSEBSecurityGroup-NOW13RANDCHARS}
              IpProtocol: tcp
              ToPort: 443
              FromPort: 443
              CidrIp: 0.0.0.0/0
  
  files:
      /etc/nginx/conf.d/ssl.conf:
          mode: "000755"
          owner: root
          group: root
          content: |
              # HTTPS server
  
              upstream nodejs {
              server 127.0.0.1:8443;
              keepalive 256;
              }
  
              server {
                      listen       443;
                      server_name  localhost;
  
                      ssl                  on;
                      ssl_certificate      /etc/pki/tls/certs/server.crt;
                      ssl_certificate_key  /etc/pki/tls/certs/server.key;
  
                      ssl_session_timeout  5m;
  
                      ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
                      ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
                      ssl_prefer_server_ciphers   on;
  
                      location / {
                              proxy_pass  http://nodejs;
                              proxy_set_header   Connection "";
                              proxy_http_version 1.1;
                              proxy_set_header        Host            $host;
                              proxy_set_header        X-Real-IP       $remote_addr;
                              proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                      }
              }
      /etc/pki/tls/certs/server.crt:
          mode: "000400"
          owner: root
          group: root
          content: |
              -----BEGIN CERTIFICATE-----
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificatethisisno
              Thisisnotmyactualcertificatethisisnotmyactualcertificate
              -----END CERTIFICATE-----
  
      /etc/pki/tls/certs/server.key:
          mode: "000400"
          owner: root
          group: root
          content: |
              -----BEGIN RSA PRIVATE KEY-----
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmyactualkeythis
              Thisisnotmyactualkeythisisnotmyactualkeythisisnotmya
              -----END RSA PRIVATE KEY-----
  </code></pre>
  
  <p>I'm not sure what I have wrong. Any insight would be helpful?</p>