title: Error code: ssl_error_rx_record_too_long on nginx ubuntu server
body: <p>I have a site which was perfectly running with apache on some old ubuntu server and also has https for it. But now for some reasons i need to move to different(new ubuntu server with high configuration) server and trying to serve my site using Nginx, and so installed nginx (<code>nginx/1.4.6 (Ubuntu)</code>). Below is my <code>nginx.conf</code> file settings</p>
  
  <pre><code>server {
    listen 8005;
  
    location / {
      proxy_pass http://127.0.0.1:8001;
    }
  
    location /static/ {
      alias /root/apps/project/static/;
    }
  
    location /media/ {
      alias  /root/apps/media/;
    }
  
  }
  
  # Https Server
  server {
        listen 443;
        location / {
  #            proxy_set_header Host $host;
  #            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  #            proxy_set_header X-Forwarded-Protocol $scheme;
  #            proxy_set_header X-Url-Scheme $scheme;
  #            proxy_redirect off;
              proxy_pass http://127.0.0.1:8001;
           }
        server_tokens off;
  
        ssl                  on;
        ssl_certificate      /etc/ssl/certificates/project.com.crt;
        ssl_certificate_key  /etc/ssl/certificates/www.project.com.key;
        ssl_session_timeout  20m;
        ssl_session_cache    shared:SSL:10m;  # ~ 40,000 sessions
        ssl_protocols        SSLv3 TLSv1; # SSLv2
        ssl_ciphers          ALL:!aNull:!eNull:!SSLv2:!kEDH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+EXP:@STRENGTH;
        ssl_prefer_server_ciphers on;
  
  
  }
  </code></pre>
  
  <p>Since i was already having https certificate(<code>project.com.crt</code>) and key(<code>www.project.com.key</code>) running on another server, i had just copied them to new server(which does not contain any domain as of now, and has only IP) and placed in at path <code>/etc/ssl/certificates/</code> and trying to use them directly. Now i had restarted Nginx and tried to access my IP <code>23.xxx.xxx.xx:8005</code> with <code>https:// 23.xxx.xxx.xx:8005</code> and i am getting the below error in firefox</p>
  
  <pre><code>Secure Connection Failed
  
  An error occurred during a connection to 23.xxx.xxx.xx:8005. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)
  
      The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
      Please contact the website owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.
  </code></pre>
  
  <p>But when i access the IP without <code>https</code>, i can able to serve my site.</p>
  
  <p>So whats wrong with my Https settings in the above nginx conf file ?
  Whether we can't serve the certificate files by simply copying and pasting at some folder ? do we need to create any extra certificate for my new server ?</p>