华为云ssl证书 nginx 1.7 配置 https

server {
    listen 443 ssl;
    server_name  域名;
    ssl_certificate cert/server.crt;
    ssl_certificate_key cert/server.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;

    location / {
        root /home/app;//路径
        index  index.html index.htm;
    }
}
server {
    listen 80;
    server_name 域名;
    rewrite ^(.*)$ https://域名:443/$1 permanent;
}

你可能感兴趣的:(webServer使用学习,新奇技术学习,ssl,https,nginx)