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

am using rails 3.2 and ruby ​​1.9 for your application, you need to run the application in https with the domain name, for example https://welcome.com on my system. so i am setting up my nginx by creating ssl certificate for domain name and https

snapshort from 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 see the nginx homepage by calling welcome.com and https://welcome.com . without running the rails application

My application also works in port 443 successfully, but after a request in a browser, for example https://welcome.com

The Rails terminal shows an error:

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

In a browser browser error:

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

I even tried to clear the browser history several times, but the result is the same.

Not sure what I did wrong, can someone help me?

Did I make any mistakes in creating the certificate?

+8
ruby-on-rails ssl ruby-on-rails-3 nginx
source share
1 answer

You cannot have as listen 443 ssl; , so ssl on; , delete the line ssl on; and restart nginx.

+10
source

All Articles