Nginx 反向代理https配置

/etc/nginx/sites-available/default

server{

       listen 443 ssl;  #ssl不能少,否则报错

       server_name  abc.com (域名,下同);

        ssl_certificate /home/abc.com/fullchain.pem; #证书位置

        ssl_certificate_key /home/abc.com/privkey.pem;

        ssl_session_timeout 5m;

        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;

        ssl_ciphers “HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES”;

        ssl_prefer_server_ciphers on;

       location / {

          proxy_pass   https://127.0.0.1;

       }

}

或者

server{

       listen 80;

           server_name  127.0.0.1 localhost  abc.com;

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

       location / {

          proxy_pass   https://127.0.0.1;

       }

}

#注意:wordpress需修改 设置》站点地址和wordpress地址 为https

刷新

systemctl reload nginx

腾讯云图