cd /etc/nginx openssl req -new -x509 -nodes -out server.crt -keyout server.key chmod 600 server.key
ssl_protocols TLSv1.2 TLSv1.1 TLSv1; ssl_prefer_server_ciphers on; ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";
If you want to support IE8/XP, change the last line to
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS +RC4 RC4";
listen 443 ssl spdy; ssl_certificate /etc/nginx/server.crt; ssl_certificate_key /etc/nginx/server.key;
location / { return 301 https://example.com$request_uri; }
proxy_redirect http:// $scheme:// proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Scheme $scheme;
openssl x509 -noout -modulus -in server.crt | openssl md5 openssl rsa -noout -modulus -in myserver.key | openssl md5
If the output are not the same, then they do not match and won't work on Nginx.
openssl req -new -newkey rsa:2048 -nodes -keyout $DOMAIN.key -out $DOMAIN.csr
If you are requesting a Wild Card certificate, please add an asterisk (*) on the left side of the common name (e.g., “*.domainnamegoeshere.com”). This will secure all subdomains of the common name.
NOTE: If you enter “www.domainnamegoeshere.com” as the Common Name in your certificate signing request, the certificate will secure both “www.domainnamegoeshere.com” and “domainnamegoeshere.com.” And vice versa.
References: