Error code: ssl_error_rx_record_too_long for https in nginx on ruby on rails application

12,542

You can't have both listen 443 ssl; and ssl on;, remove the ssl on; line and restart nginx.

Share:
12,542
God
Author by

God

i love to learn

Updated on July 25, 2022

Comments

  • God
    God almost 2 years

    am using rails 3.2 and ruby 1.9 for my app, have to run application in https with domain name like https://welcome.com on my system. so i configure my nginx by creating ssl certificate for domain name and https

    snapshort of ssl:

    # HTTPS server
    #
    server {
        listen 443 ssl;
    server_name welcome.com;
    
    root html;
    index index.html index.htm;
    
    ssl on;
    ssl_certificate /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    
    ssl_session_timeout 5m;
    }
    

    i can able to saw nginx home page by calling welcome.com and https://welcome.com. without running the rails application

    My application also running in port 443 successfully, but after querying in browser like https://welcome.com

    Rails terminal showing error:

     ERROR bad Request-Line `\x16\x03\x01\x00�\x01\x00\x00�\
     ERROR bad URI `._i\b8\x10�yA�^6�v�M|
    

    In browser throwing error:

    SSL received a record that exceeded the maximum permissible length.
    
    (Error code: ssl_error_rx_record_too_long)
    

    Even tried by clearing browser history repeatedly, but the result is same.

    Am not sure what i made wrong, can any one help me?

    have i made any wrong in certificate creation ?