80端口默认转到443端口及443端口配置

server {
    listen       80;
    server_name  www.cookie.com;
    charset utf-8;
 

   rewrite ^(.*) https://$server_name$1 permanent;


       location / {
        root   /www/cookie.com/www.cookie.com;
        index  index.html;
    }

}


server{
    listen 443;
    server_name  www.cookie.com;
    charset utf-8;

    ssl                  on;
    ssl_certificate      /etc/nginx/ssl/all.cookie.com.crt;
    ssl_certificate_key  /etc/nginx/ssl/all.cookie.com.key;


    ssl_session_timeout  5m;

    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers  HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM;
    ssl_prefer_server_ciphers   on;



    location / {
        root   /www/cookie.com/www.cookie.com;
        index  index.html;
    }

}


你可能感兴趣的:(nginx)