Crear certificado https para NGINX

Generación ficheros

Generamos el par de claves (privada y pública). Cuando nos pregunte el Common Name (e.g. server FQDN or YOUR name), ponemos el nombre DNS del servidor (por ejemplo, midominio.org)

openssl req -newkey rsa:2048 -nodes -keyout certificado.key -x509 -days 365 -out certifcado.pub

Configuración NGINX

...
http {
...
  server {
    listen      443;

    ssl_certificate           /etc/nginx/certs/cerfificado.pub;
    ssl_certificate_key       /etc/nginx/certs/cerfificado.key;

    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

    server_name midominio.org;
    index       index.html;
    root        html;

    location / {
      ...
    }
  }
...
}