Linux security certificate request and configuration to Nginx

Source: Internet
Author: User
Tags letsencrypt

wget https://raw.githubusercontent.com/xdtianyu/scripts/master/lets-encrypt/letsencrypt.sh
chmod +x letsencrypt.sh

Edit the following configuration file:

Vim letsencrypt.conf

account_key= "Letsencrypt-account.key" domain_key= "domain name. KEY" domain_dir= "Web site Folder" domains= "DNS: Domain name, DNS: domain name" #ECC =true# Lighttpd=true

Run:

./letsencrypt.sh letsencrypt.conf

Many files are generated after running

which

WWW.CHAINED.CRT domain name. Key

These two are for you.

Nginx Configuration:

User www;worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log inf o; #pid logs/nginx.pid;events {worker_connections 1024;}    HTTP {include mime.types;    Default_type Application/octet-stream;    #access_log Logs/access.log Main;    Sendfile on;    #tcp_nopush on;    #keepalive_timeout 0;    Keepalive_timeout 65;    #gzip on;        server {Listen 80; server_name domain name;
#实现自动重写 rewrite ^ (. *) $ https://$host $ permanent; # HTTPS Server server {listen 443 SSL; server_name domain name; #charset: Utf-8; SSL_CERTIFICATE/HOME/WWWROOT/WWW.CHAINED.CRT; ssl_certificate_key/home/wwwroot/domain name. Key; Ssl_protocols TLSv1 TLSv1.1 TLSv1.2; Location/{root Web folder; Index index.html index.htm index.php; } location ~ \.php$ {fastcgi_buffer_size 128k; Fastcgi_buffers 32k; root Web Folder; Fastcgi_pass Unix:/tmp/php-fpm.sock; Fastcgi_index index.php; #include fastcgi.conf; Fastcgi_param Document_root website folder; Fastcgi_param script_filename website folder $fastcgi_script_name; Include Fastcgi_params; } error_page 502 503 504/50x.html; Location =/50x.html {root html; } }}

  

Linux security certificate request and configuration to Nginx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.