Introduction to SSL certificate installation and deployment steps under Nginx

Introduction to SSL certificate installation and deployment steps under Nginx

Problem description:

The editor encountered an expiration of the https protocol, so he reapplied and deployed the SSL certificate on the Nginx server

Installation Steps

1. Preparation

In the SSL Certificate Management Console, download and decompress the cloud.tencent.com certificate file package to a local directory.

After decompression, you can obtain the certificate file of the relevant type. It contains the Nginx folder and the CSR file:

Folder Name: Nginx

Folder Contents:

1_cloud.tencent.com_bundle.crt certificate file

2_cloud.tencent.com.key private key file

CSR file content: cloud.tencent.com.csr file

2. Remotely connect to the server

insert image description here

3. Copy the certificate and private key files

Copy the obtained 1_cloud.tencent.com_bundle.crt certificate file and 2_cloud.tencent.com.key private key file from the local directory to the /usr/local/nginx/conf directory of the Nginx server (this is the default installation directory of Nginx, please operate according to the actual situation).

I have these two.

4. Edit the conf/nginx.conf file in the Nginx root directory

The edited content is as follows:

// Edit content server {
        #SSL access port number is 443
        listen 443 ssl; 
        #Fill in the domain name of the bound certificate server_name cloud.tencent.com; //Fill in the certificate domain name here#Certificate file name ssl_certificate 1_cloud.tencent.com_bundle.crt; //Fill in the name of the certificate file just copied here#Private key file name ssl_certificate_key 2_cloud.tencent.com.key; //Fill in the name of the private key file just copied here ssl_session_timeout 5m;
        #Please configure ssl_protocols according to the following protocols TLSv1 TLSv1.1 TLSv1.2; 
        #Please configure the encryption suite according to the following suite configuration, and the writing method follows the openssl standard.
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; 
        ssl_prefer_server_ciphers on;
        location / {
           #Website homepage path. This path is for reference only. Please follow the actual directory for specific operations.
           #For example, if your website's running directory is in /etc/www, fill in /etc/www.
            root html; 
            index index.html index.htm;
        }
    }

5. In the Nginx root directory, verify the configuration file problem by executing the following command

//In the nginx root directory, enter nginx -t in cmd

After input, the question will be displayed. If there is a problem, modify it according to the problem. If not, proceed to the next step

6. Restart Nginx and access the website

// Restart Nginx
nginx -s stop
start nginx

This is the end of this article about the steps to install and deploy SSL certificates under Nginx. For more information about Nginx deployment of SSL certificates, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Example of how to configure nginx to implement SSL
  • Solution to Nginx SSL certificate configuration error
  • Nginx domain name SSL certificate configuration (website http upgraded to https)
  • Nginx configuration SSL and WSS steps introduction

<<:  HTML Basics Must-Read---Detailed Explanation of Forms, Image Hotspots, Web Page Division and Splicing

>>:  Detailed explanation of the seven data types in JavaScript

Recommend

JavaScript implements countdown on front-end web page

Use native JavaScript to simply implement the cou...

JS implements the rock-paper-scissors game

This article example shares the specific code of ...

Pure CSS3 code to implement a running clock

Operation effectCode Implementation html <div ...

Complete MySQL Learning Notes

Table of contents MyISAM and InnoDB Reasons for p...

How to clear the cache after using keep-alive in vue

What is keepalive? In normal development, some co...

Weather icon animation effect implemented by CSS3

Achieve results Implementation Code html <div ...

MySQL database table partitioning considerations [recommended]

Table partitioning is different from database par...

Vue defines private filters and basic usage

The methods and concepts of private filters and g...

VMware Workstation 14 Pro installation and activation graphic tutorial

This article shares the installation and activati...

Basic usage and pitfalls of JavaScript array sort() method

Preface In daily code development, there are many...

Docker-compose steps to configure the spring environment

Recently, I need to package the project for membe...

Detailed explanation of several ways to export data in Mysql

There are many purposes for exporting MySQL data,...