申请的ssl证书的网址:https://www.pianyissl.com/
由于是测试,所以选择免费的可试用
申请后会有个压缩包
里面有个nginx文件夹,把下面的
server.key
server.pem
这两个文件上传到服务器上。
在这个我把这两个文件移动到/usr/local/nginx/conf 目录下
server 端编译nginx时需要加参数
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6
make && make install
关于nginx配置https配置,追加以下内容
# HTTPS server
server {
                listen 443;
                server_name apk.moootooo.com;
                ssl on;
                ssl_certificate server.pem;
                ssl_certificate_key server.key;
                ssl_session_timeout 5m;
                ssl_protocols SSLv3 TLSv1;
                ssl_ciphers HIGH:!ADH:!EXPORT56:RC4+RSA:+MEDIUM;
                ssl_prefer_server_ciphers on;
                location / {
                        root html;
                        index index.html index.htm;
                }
        }
原文:http://rockycai.blog.51cto.com/8871643/1882290