Install SSL certificates in Linux and Nginx

Source: Internet
Author: User
: This article describes how to install the SSL certificate in Linux + Nginx. For more information about PHP tutorials, see. I. Nginx requires two configuration files to install the SSL certificate

Export root_bundle.crt and 2_domainname.com.key.

Note: These three certificate files are in the folder for Nginx.zip. for example, export root_bundle.crt is the root certificate chain (public key), and 2 _ domainname.com. key is the private key.

(The certificate public key and private key file are generally named after your domain name; the certificate suffix crt and cer are of the same nature ).

II. Nginx installation certificate

1. open the Nginx. conf file in the conf directory under the nginx installation directory
Find:
# HTTPS server
#
# Server {
# Listen 443;
# Server_name localhost;
# Ssl on;
# Ssl_certificate cert. pem;
# Ssl_certificate_key cert. key;
# Ssl_session_timeout 5 m;
# Ssl_protocols SSLv2 SSLv3 TLSv1;
# Ssl_ciphers ALL :! ADH :! EXPORT56: RC4 + RSA: + HIGH: + MEDIUM: + LOW: + SSLv2: + EXP;
# Ssl_prefer_server_ciphers on;
# Location /{
# Root html;
# Index index.html index.htm;
#}
#}

Modify it:
Server {
Listen 443;
Server_name localhost;
Ssl on;
Ssl_certificate certificate root_bundle.crt; (Certificate public key)
Ssl_certificate_key 2 _ domainname.com. key; (Certificate private key)
Ssl_session_timeout 5 m;
Ssl_protocols SSLv3 TLSv1;
Ssl_ciphers HIGH :! ADH :! EXPORT56: RC4 + RSA: + MEDIUM;
Ssl_prefer_server_ciphers on;
Location /{
Root html;
Index index.html index.htm;
}
}

Note: After the configuration is complete, make sure that the website path and the hosts page are consistent with port 80.

2. start nginx and access the domain name bound to https: // + certificate

Note: If the website cannot be accessed through https after deployment, check whether port 443 of the server is enabled or blocked by acceleration tools such as website guard.
(1) enabling method: Firewall settings-exception port-add port 443 (TCP ).
(2) If blocked by security or acceleration tools, you can add 443 to the trust list in the interception record.
After restart, access through https again.


For more information, see the link: http://www.zzidc.com/main/help/showHelpContent/id_460.html

The above describes how to install the SSL certificate in Linux + Nginx, including some content. if you are interested in the PHP Tutorial.

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.