: 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.