Nginx Enable HTTPS

Source: Internet
Author: User
Next, after installing Nginx, enable HTTPS

1. Open https://freessl.org,

Fill in your domain name in the input box to create a free certificate

Enter your email address as required, then click on "Generate"

Login domain name management platform Add resolution record, record type TXT, host record selected TXT record, record value corresponding record value.

Then wait 2 minutes after the point verification. Or, after you add DNS resolution, you can click manually to verify
It then generates a certificate file and a private key file that can be downloaded

These two files are what we want to use.

Vim/etc/nginx/nginx.conf, enable the following option to add the certificate path.

/usr/sbin/nginx–t Check the Nginx configuration file, no problem, you can restart Nginx

Systemctl Restart Nginx.service

You can then use HTTPS to access your website,

If you want to make HTTP jump to HTTPS, add a line of code to the location
Rewrite ^ (. *) https://$server _name$1 permanent;
The egg (not filed)

Nginx Enable 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.