Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Let's Encrypt with semiautomatic into Nginx configuration https     - How to configure Ceph stored on CentOS 7.0 (Server)

- CentOS 7 x64 compiler installation Tengine 2.0.3 Comments (Server)

- Computer security protection remove local and remote system log files (Linux)

- Oracle 12C RAC optimizer_adaptive_features cause of data into overtime (Database)

- How to disable IPv6 in the CentOS 7 (Linux)

- RAID configuration and management under linux (Server)

- I like Linux Security (Linux)

- Ubuntu 14.04 / Linux Mint 17 How to install the MintMenu 5.5.2 menu (Linux)

- Configuring LIDS build Linux kernel security intrusion detection system (Linux)

- Expand an existing RAID arrays and remove the failed disk in a RAID (Linux)

- Questions about Linux compiler u-boot (Programming)

- Linux 0.12 kernel and modern kernels difference in memory management (Linux)

- Network security system (Network)

- Axel install plug under CentOS 5/6 acceleration yum downloads (Linux)

- Bash environment is automatically install and initialize oh-my-zsh & autojump zsh (Linux)

- LAMP environment to build Apache, MySQL, PHP under Ubuntu (Server)

- Linux (RHEL6 CENTOS6 OLE6) VNC-SERVER Installation and Configuration (Server)

- Install Oracle database error process of [INS-35172] (Database)

- Kernel compile under Debian (Linux)

- Docker Private Registry Installation Guide at CentOS6.X (Linux)

  Let's Encrypt with semiautomatic into Nginx configuration https
  Add Date : 2018-11-21      
  With Let's Encrypt, configure SSL certificate is no longer difficult, but Let's Encrypt is still in its very early stages, for nginx automated configuration support is not good. But we can write their own point of feet have been semi-automated configuration of our own nginx server.

One line of command is all pointing nginx domain on this server for SSL Certificates
With the Crontab task to automatically renew certificates
Simple nginx configuration examples. You can redirect all www at the beginning of the domain name to the domain name without the www, you can also get a A + rating of SSL Labs.

I Let's Encrypt as a submodule integrated into this project it. So only you need to clone a project that is enough.

git clone https://github.com/songchenwen/nginx-ssl-config-with-letsencrypt.git
cd nginx-ssl-config-with-letsencrypt
git submodule init
git submodule update --remote

Request a certificate

Edit ssl / config

Fill in your domain name. Can fill more than one domain name, the domain name will be used as the first Common Name. Certificates will be stored in / etc / letsencrypt / live / down, next to Common Name directory named.

Let's Encrypt select a server. acme-v01 server is the official beginning of the server, there are strict limits the number of requests, we do not recommend it to do the experiment. acme-staging at the beginning of the server is a test server, there is no limit the number of requests, but does not check out a valid certificate, it is recommended to use this server to test the configuration.

Configuring nginx

Let's Encrypt in the application and renewal of certificates need to use a http server to put a file so that it can verify your ownership of this domain.

I use a simple configuration file letsencrypt_challenge nginx to redirect all domain names point to this server http request to the corresponding https requests, leaving only the required verification Let's Encrypt URL remain on http.

sudo cp nginx-config / letsencrypt_challenge / etc / nginx / sites-available / letsencrypt_challenge
sudo ln -s / etc / nginx / sites-available / letsencrypt_challenge / etc / nginx / sites-enabled / letsencrypt_challenge
sudo nginx -s reload

Execute scripts

Executive ssl / apply_all_certs.sh, follow the prompts to fill in your email, then you can apply for a certificate of good.

bash ssl / apply_all_certs.sh
sudo nginx -s reload
nginx configuration file example

In nginx-config directory, there are three more useful nginx configuration files. Remember to modify them before using, at least remember to replace my domain name to you.

letsencrypt_challenge redirect all point to this server domain http https request to the corresponding request, leaving only the required verification Let's Encrypt URL remain on http.
www_to_none_www redirect all www domain names beginning with https request to the corresponding domain name does not begin with www.
sample_config is a simple server configuration file. This profile can help you easily get SSL Labs on A's score. To the line before the last} configuration uncommented will open HSTS, so your score will become A +.
Crontab mandate automatic renewal certificate

Let's Encrypt certificate issued is valid only for 90 days, so we need a method to automatically renew certificates. A renewal of Crontab task once a month is sufficient. This task should be executed as root, because then we also need to be renewed after about nginx reload configuration to take effect.

sudo crontab -e
Here is the content Crontab task

0 2 1 1-12 * /path/to/ssl/renew_all_certs.sh
- Elixir: the future of programming languages (Programming)
- Analysis: Little Notebook facing a major security threat secure online (Linux)
- Linux shell script to adjust the Task Scheduler (Linux)
- Create the best introductory tutorial REST API (Linux)
- dd command: do hard disk IO performance test (Linux)
- Java implementation of stacks and queues (Programming)
- The Linux role of each directory contents (Linux)
- Install and configure GO 1.2.1 under CentOS 6.5 (Linux)
- Reset CentOS / RHEL root account password 7 (Linux)
- Install Mac OS X 10.9 systems VMware10 (Linux)
- Linux console password solution (Programming)
- exp / imp Export Import version of the problem and the ORA-6550 error (Database)
- Examples of safety testing system notes for RedHat Linux (Linux)
- Linux --- manual release system cache (Linux)
- Spring + Log4j + ActiveMQ remote logging - Analysis of combat (Server)
- CentOS 7 Configure logging (VirtualBox) (Linux)
- Linux configuration startup mount: fstab file (Linux)
- OpenDJ installed on RHEL6 (Linux)
- Linux NFS service fixed ports and firewall configuration (Linux)
- Get the Linux device PCI ID method (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.