nginx automatically updates the ssl certificate.

1. First install nginx.

2. The automatic acquisition of the ssl certificate is achieved through the ssh service of linux. First, ensure that the ssh service and the ngxin service are normal. Then add two configuration files.

 add default

  server {
        listen       80;
        server_name  _;
        location /.well-known/ {
                root /;
                rewrite ^/.well-known/(.*)$ /.well-known/$1 break;
        }
        location =/ {

             rewrite ^(.*)$ https://www.xxx.com;
        }

        }

    rewrite ^/.well-known/(.*)$ /.well-known/$1 break;  

   Here is the configuration directory information uploaded from the https://www.sslforfree.com website. When it is automatically generated, two files will be uploaded to /.well-known. If the download is successful, a valid certificate will be generated.

 

3. Automatically generate certificates

   

In the generated certificate file, and then update the nginx certificate of the service, nginx -s reload can see the effect.

 


 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324440786&siteId=291194637