Nginx SSL setup

Create Certificate from FreeSSL.cn

http://FreeSSL.cn

MacOS : KeyManager : PW: yourpassword

Export Key to local drive

Config DNS server and validate.

Export to local drive

Setup SSL for yourdomain.com

SSL directory

Remote:

/usr/local/nginx/conf/ssl/yourdomain.com

Local:

/Users/username/FreeSSL/yourdomain.com

Sftp to blog.ieeelab.com

$sftp -P xxxx root@yourdomain.com

$cd /usr/local/nginx/conf/ssl/yourdomain.com/

$put /usr/local/nginx/conf/ssl/yourdomain.com_key.key

$put /usr/local/nginx/conf/ssl/yourdomain.com_chain.crt

Key Files.

/usr/local/nginx/conf/ssl/yourdomain.com_chain.crt;

/usr/local/nginx/conf/ssl/yourdomain.com_key.key;

Modify nginx.conf

$cd /usr/local/nginx/conf/vhost

$nano yourdomain.com.conf

server

    {

        listen 443 ssl;

        #listen [::]:443 ssl http2;

        server_name yourdomain.com

        index index.html index.htm index.php default.html default.htm default.php;

        root  /home/wwwroot/yourdomain.com;

        ssl on;

       ssl_certificate /usr/local/nginx/conf/ssl/yourdomain.com_chain.crt;

        ssl_certificate_key /usr/local/nginx/conf/ssl/yourdomain.com_key.key;

}

Reboot Server

$/etc/init.d/nginx restart

All DONE!

Leave a Reply

Your email address will not be published. Required fields are marked *