Environmental Description Server system: Ubuntu 18.04 64-bit This article mainly records the steps to configure https, and does not introduce the details of applying for a CA certificate. There are free SSL certificates here: https://cloud.tencent.com/act/pro/ssl I have a domain name of West Digital and applied for a certificate in Tencent Cloud After applying for the certificate and issuing it, download the certificate to your local computer first. 1. Install nginx$ apt-get update // Update software $ apt-get install nginx // Install nginx 2. Configure CA certificate 2.1 The installation directory of nginx is /etc/nginx/. Enter the directory, add the cert folder, and upload the two files just downloaded to the cert folder. 2.2 Add a new configuration file blog.conf in the /etc/nginx/conf.d/ folder. The name is arbitrary. Nginx will read all configuration files in the conf.d/ folder. 2.3 Copy the following configuration information into the blog.conf file server { listen 443; server_name xiaoxina.cc; //your domain name ssl on; root /var/lib/jenkins/workspace/blog; // Your website source directory index index.html index.htm; ssl_certificate /etc/nginx/cert/xiaoxina.cc.crt; // Certificate address ssl_certificate_key /etc/nginx/cert/xiaoxina.cc.key; // Certificate address 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; ssl_session_cache builtin:1000 shared:SSL:10m; ssl_buffer_size 1400; add_header Strict-Transport-Security max-age=15768000; ssl_stapling on; ssl_stapling_verify on; location / { index index.html index.htm; } } server { listen 80; server_name xiaoxina.cc; // your domain name rewrite ^(.*)$ https://$host$1 permanent; } After the configuration is complete, check whether the nginx configuration file is available. If successful appears, it means the configuration is correct. $ nginx -t After the configuration is correct, reload the configuration file to make the configuration take effect: $ service nginx reload This is the end of this article about the example of configuring nginx ssl to implement https. For more relevant content about nginx implementing https, 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:
|
<<: Simple example of adding and removing HTML nodes
>>: MySQL 8.0.23 installation and configuration method graphic tutorial under win10
Rendering If you want to achieve the effect shown...
Recently, I need to make a back-to-top button whe...
1. Installation of Docker under CentOS8 curl http...
0. Environment Operating system for this article:...
Copy code The code is as follows: <pre> <...
question: When I was doing project statistics rec...
[LeetCode] 180. Consecutive Numbers Write a SQL q...
This article describes how to boot the Linux syst...
Preface Those who have played with MySQL must be ...
Preface Golang provides the database/sql package ...
1 Download the MySQL 5.6 version compressed packa...
A system administrator may manage multiple server...
1. The startup menu is to move the cursor to the ...
1. Goal: Change the value of character_set_server...
Requirement: Celery is introduced in Django. When...