One: Start Nginx SSL Module 1.1 nginx If the SSL module is not turned on, you are prompted with an error when configuring HTTPS
| 1 |
nginx: [emerg] the "ssl"parameter requires ngx_http_ssl_module in/usr/local/nginx/conf/nginx.conf:37 |
The reason is also very simple, Nginx missing http_ssl_module module, compile and install the time with the--with-http_ssl_module configuration on the line, but now the situation is my nginx has been installed, how to add modules, in fact, is very simple, look down: Make a note: My Nginx installation directory is/usr/local/nginx this directory, my source package in the/usr/local/src/nginx-1.6.2 directory 1.2 nginx Open SSL module
Switch to the source package:
| 1 |
cd /usr/local/src/nginx-1.11.3 |
View Nginx's original module
| 1 |
/usr/local/nginx/sbin/nginx -V |
In Configure arguments: The original configure parameters shown later are as follows:
| 1 |
--prefix=/usr/local/nginx --with-http_stub_status_module |
Then our new configuration information should be written like this:
| 1 |
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_modul |
Run the above command, wait for the configuration to finish
After the configuration is complete, run the command
Do not install here, or overwrite the installation
Then back up the original installed Nginx
| 1 |
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak |
Then the newly compiled Nginx cover the original Nginx (this time nginx to stop the state)
| 1 |
cp ./objs/nginx /usr/local/nginx/sbin/ |
Then start Nginx and still be able to see if the success has been joined by the command
| 1 |
/usr/local/nginx/sbin/nginx -V |
Nginx configuration http and HTTPS coexistence
| 123456789 |
server { listen 80 defaultbacklog=2048; listen 443 ssl; server_name wosign.com; root /var/www/html; ssl_certificate /usr/local/Tengine/sslcrt/ wosign.com.crt; ssl_certificate_key /usr/local/Tengine/sslcrt/ wosign.com .Key; } |
Put SSL on; this line is removed and SSL is written behind port 443. This allows both HTTP and HTTPS links to be used
Nginx Configure SSL Security certificate Restart to avoid entering a password
The private key can be used to do this thing. Generate a decrypted key file instead of the original key file.
| 1 |
openssl rsa -inserver.key -outserver.key.unsecure |
Nginx SSL Performance Tuning
| 12345 |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM;ssl_prefer_server_ciphers on;ssl_session_cache shared:SSL:10m;ssl_session_timeout 10m; |
Reference: https://www.cnblogs.com/ghjbk/p/6744131.html
Nginx Use HTTPS function