Introduction to HTTP and HTTPS

HTTP: The most widely used network protocol. It is a B/S request and response standard for transferring hypertext from WWW servers to local browsers.

HTTPS: the SECURE Sockets Layer (SSL) is added to the HTTP channel for security purposes. The SECURE Sockets Layer (SSL) is used to secure HTTPS, so SSL is required for encrypting details.

The difference between

Security: HTTP is a hypertext transmission protocol, and information is transmitted in plain text. HTTPS is a secure SSL encryption transmission protocol.

Port: HTTP and HTTPS use completely different connections and use different ports, the former 80 and the latter 443.

Stateless: HTTP connections are simple and stateless; HTTPS is a network protocol based on SSL and HTTP that encrypts transmission and authenticates identity.

1. Use OpenSSL to generate a certificate

Openssl is the most popular SSL password library tool, which supports SSL/TLS protocol implementation.

Note: Be sure to install the http_SSL_module to see if Nginx is installed

Creating an SSL directory

Generate a certificate

Openssl the req - x509 - nodes - days 36500 - newkey rsa: 2048 - keyout/home/odysee nginx1.8 / SSL/nginx. Key - out / home/odysee nginx1.8 / SSL/nginx. CRTCopy the code

View the output file

2. Modify the nginx configuration

Common users are not allowed to access ports below 1024

So the following ports 80– >8888, 443– >4433, you configure yourself

The SSL certificate is not trusted by the browser, so the following appears

If it is still convenient to deploy privately, note that HTTPS can be deployed without port 443 (you can set other ports as well).

If deployed on the Internet, you need to go to the corresponding CA certificate authority to apply for a certificate (Ali and Tencent have 1-2 years free certificate can apply, pay attention to the expiration), so that the browser will not appear “not trusted by the browser”