A
A
Anton Misyagin2015-12-20 22:01:05
Nginx
Anton Misyagin, 2015-12-20 22:01:05

How to make a rail application work over https?

I am not familiar with ssl certificates. What I tried to read - a dark forest. But you need to run in production on https. While I'm trying on a staging server. How to do?
staging.rb nginx.conf
config.force_ssl = true

server {
    listen 443;
    server_name m.y.i.p;

    ssl                        on;
    ssl_certificate            staging.crt;
    ssl_certificate_key        staging.key;
    ssl_session_timeout        5m;
    ssl_protocols              SSLv2 SSLv3 TLSv1;
    ssl_ciphers                HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;


    root /var/www/site/current/public;
    passenger_enabled on;
    passenger_env_var RAILS_ENV staging;

    
  }

sudo openssl req -new -nodes -keyout staging.key -out staging.csr
sudo openssl x509 -req -days 5036 -in staging.csr -signkey staging.key -out staging.crt
sudo nginx -t
nginx: configuration file /etc /nginx/nginx.conf test is successful

Running:
Your connection is not secure

Attackers may be trying to steal your data from the myip site (for example, passwords, messages, or bank card numbers). NET::ERR_CERT_AUTHORITY_INVALID


Did according to Ryan Bates
#357 Adding SSL

In a nutshell, more about certificates, if possible. Why are they paid and not free? It's still not clear what. Will all pages work using a secure protocol? Or is it possible to include all this only on some pages?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question