阿里云免费DV证书Nginx配置https并http强制跳转https

ssl.config

server {
    listen       443;
    server_name  treetask.cn;
    ssl on;
    root         /www;
    ssl_certificate cert/b.pem;
    ssl_certificate_key cert/b.key;
    ssl_session_timeout  10m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

   ssl_prefer_server_ciphers on;
#
#    # Load configuration files for the default server block.
#    include /etc/nginx/default.d/*.conf;

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

    location /api {
         proxy_pass http://127.0.0.1:8181/;
    }



#
#    error_page 404 /404.html;
#        location = /40x.html {
#    }
#
#    error_page 500 502 503 504 /50x.html;
#        location = /50x.html {
#    }
}


猜你喜欢

转载自blog.csdn.net/leisure_life/article/details/94650058