HTTPS (full name: HypertextTransferProtocoloverSecureSocketLayer) is an HTTP channel targeted at security. It is simply a secure version of HTTP. That is, the SSL layer is added under HTTP, and the security foundation of HTTPS is SSL. It is a URIscheme (Abstract identifier system) with syntaxes similar to http: system. Secure HTTP data transmission. Https: the URL indicates that it uses HTTP, but HTT
HTTPS (full name: Hypertext Transfer Protocol over Secure Socket Layer) is an HTTP channel targeted at security. It is simply a Secure version of HTTP. That is, the SSL layer is added under HTTP, and the security foundation of HTTPS is SSL.
It is a URI scheme (Abstract identifier system) with syntaxes similar to http: system. Secure HTTP data transmission. Https: the URL indicates that HTTP is used, but HTTPS has a default port different from HTTP and an encryption/authentication layer (between HTTP and TCP ). The system was initially developed by Netscape, which provides authentication and encrypted communication methods and is now widely used for secure and sensitive communications on the World Wide Web, such as transaction payment.
Confirm that Nginx supports the OpenSSL Module
Run the following command:
nginx -V nginx: nginx version: nginx/1.0.0nginx: built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5) nginx: TLS SNI support enablednginx: configure arguments: --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module |
If no-with-http_ssl_module compilation parameter is found, it is not supported. Nginx does not support SSL by default. You need to add-with-http_ssl_module parameters to recompile.
Generate Certificate
An SSL certificate is a digital certificate similar to an electronic copy of a driver's license, passport, or business license. The SSL certificate is designed and developed by Netscape Communication by establishing an SSL Secure Channel (Secure socket layer (SSL) protocol between the client browser and the Web server. This security protocol is mainly used to authenticate users and servers, encrypt and hide transmitted data, and ensure that data is not changed during transmission, that is, data integrity, it has become the standard of globalization in this field. As SSL technology has been established in all major browsers and WEB server programs, you only need to install the server certificate to activate this function ). That is, the SSL protocol can be activated to implement encrypted transmission of data between the client and the server to prevent data information leakage. This ensures the security of the information transmitted by both parties, and the user can verify whether the website he or she accesses is authentic and reliable through the server certificate.
The certificate is divided into a self-signed certificate and a certificate issued by the CA. For details about the generation method, see [configure Apache HTTPS under Ubuntu] Article http://www.linuxidc.com/Linux/2011-11/47479.htm
You can also apply for a free StartSSL CA certificate:
StartSSL (Company Name: StartCom) is also a CA. Its root certificate was supported by some browsers with open source background (FirefoxBrowser, Google Chrome browser, and Apple Safari browser ).
Application address: http://www.startssl.com
Application Method reference: http://www.linuxidc.com/Linux/2011-11/47478.htm
Configure Nginx
Modify the corresponding server segment in nginx. conf and add the following content:
Listen443; Server_name www. mike. me;# Enable the SSL moduleSsl on;# Certificate file placement pathSsl_certificate/Etc/Ssl/Private/Yiji. cer;# Private key file placement pathSsl_certificate_key/Etc/Ssl/Private/Yiji. key;
Note: The SSL digital certificate path and domain name are modified according to the actual situation.
Restart Nginx
# Test whether the Nginx main configuration file is correctNginx-T# Smoothly restart NginxNginx-SReload |
Use HTTPS to access the website
When you access https: // ip or domain name, the browser will pop up the server certificate installation window. This indicates that the server supports SSL.