Nginx uses SSL to configure HTTPS

Source: Internet
Author: User
Tags openssl rsa openssl x509

Create a server private key

OpenSSL genrsa-des3-out Server.key 1024

Create a certificate for the signing request (CSR)

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

load SSL-supported Nginx and remove the required password when using the above private key:

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

The last token certificate uses the above private key and the CSR

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

Configure Nginx

Let Nginx http and https take effect simultaneously

server {Listen 80;        Listen 443 SSL;        server_name my.xx.com;        root/data/htdocs/365;        Index index.php;        SSL_CERTIFICATE/TMP/SERVER.CRT; Ssl_certificate_key/tmp/server.key;}

The Web Access via HTTPS and HTTP can be done by restarting Nginx.

Nginx uses SSL to configure HTTPS

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.