Nginx https证书配置

server {

listen 80;

server_name api.hgtengfei.cn;

location / {

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header Host $http_host;

proxy_pass http://127.0.0.1:6868; }

}


server {
    listen 443;
    server_name api.hgtengfei.cn;
    ssl on;
    ssl_certificate   /var/local/https/Nginx/1_api.hgtengfei.cn_bundle.crt;
    ssl_certificate_key  /var/local/https/Nginx/2_api.hgtengfei.cn.key;
    ssl_session_timeout 5m;
    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;
    location / {

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header Host $http_host;

        proxy_pass http://127.0.0.1:6868; }


}

你可能感兴趣的:(Nginx https证书配置)