文章会有【原创】或者【转载】标示,部分来自Google Baidu的学习结果 {Java/PHP/Python/Ruby/Go}

Ubuntu Nginx 配置https【原创】  


nginx -V
查看nginx 的ssl配置有没有–with-http_ssl_module

apt-get install openssl

cd /opt/nginx/conf
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
openssl rsa -in server.key -out server_nopwd.key
openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt

server {
        #listen   80;
        listen 443;
        server_name  so.imop.us;
        access_log  /var/log/nginx/xphp.access.log;
        root /var/houhuiyang/xphp/demo;
        index index.php index.html index.htm;

        ssl on;
        ssl_certificate  /etc/nginx/server.crt;
        ssl_certificate_key  /etc/nginx/server_nopwd.key;
        ...
}

https://so.imop.us