SSL configuration method for Nginx security certificate under Linux

Source: Internet
Author: User
Tags openssl openssl library openssl x509

Share how I step-by-step to configure SSL on Nginx.
First, make sure that the OpenSSL library is installed and that the –with-http_ssl_module parameter is used when installing Nginx.

Beginner or rookie recommends using LNMP for one-click installation.

To generate a certificate:
Enter the directory where you want to generate the certificate
Cd/usr/local/nginx/conf

Create a server private key using OpenSSL and enter the information for the appropriate prompt

OpenSSL genrsa-des3-out Server.key 1024

Create certificate signing requests (Certificate Signing request (CSR))

OpenSSL Req-new-key server.key-out SERVER.CSR

Clear prompt must enter key when starting Nginx with SSL

CP Server.key Server.key.orgopenssl rsa-in server.key.org-out Server.key

Signing a certificate with a newly generated private key and CSR

OpenSSL x509-req-days 365-in server.csr-signkey server.key-out server.crt

Configuration Description:
Join in Server

SSL On;ssl_certificate/usr/local/nginx/conf/server.crt;ssl_certificate_key/usr/local/nginx/conf/server.key;

Set the listen port to 443 and start the test.

SSL configuration method for Nginx security certificate under Linux

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.