Nginx HTTPS configuration

Source: Internet
Author: User

Testing self-signed SSL certificates

Start by executing the following command to generate a key

OpenSSL Genrsa-des3-out1024x768

Then he will ask you to enter the password for this key file. Input is not recommended. Because it will be used for nginx later. Each time you reload Nginx configuration, you need to verify this Pam password.
Because the password must be entered at the time of generation. You can type and then delete.

- in Xxx.key- out ssl.keyrm xxx.key

Then generate the certificate request file based on this key file

OpenSSL req-new -key Ssl.key- out SSL.CSR

When the above command to fill a lot of things to read one by one (can casually, after all, this is the certificate of their own generation)

Finally, a CRT certificate file is generated from these 2 files

36500 - in Ssl.csr-signkey ssl.key- out SSL.CRT
Here 36500 is the certificate validity period, this everyone casual. The last file used is the key and the CRT file

The following is the Nginx configuration

upstream MMC {server192.168.0.44:8080weight=Ten;} server {Listen the;    server_name aaa.com; Rewrite^/(. *) https://$server _name$1 Permanent;}server {Listen443SSL;    server_name aaa.com;    SSL on; Ssl_certificate/home/mmc/SSL.CRT; Ssl_certificate_key/home/mmc/Ssl.key;            Ssl_session_timeout 5m; Location/{proxy_pass http://MMC;    }}

Nginx HTTPS configuration

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.