How to set up https on you domain

Make ssl dir if does not exist
sudo mkdir /etc/nginx/ssl

Generate certificates and keys
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout /etc/nginx/ssl/domain.key -out /etc/nginx/ssl/domain.crt

Update you nginx config
Set redirect http->https
server { listen $ip:80; server_name www.domain domain; return 301 https://domain$request_uri; }

Add certificates for you domain
listen $ip:443; ssl on; ssl_certificate /etc/nginx/ssl/domain.crt; ssl_certificate_key /etc/nginx/ssl/domain.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on;