The ssl module is not installed by default. If you want to use this module, you need to specify the –with-http_ssl_module parameter at compile time. The installation module depends on the OpenSSL library and some reference files. Usually these files are not in the same package. Usually this file name is similar to libssl-dev. Generating a certificate You can generate a simple certificate by following these steps: First, enter the directory where you want to create the certificate and private key, for example:
$ cd /usr/local/nginx/conf
Create a server private key, the command will Lets you enter a password:
$ openssl genrsa -des3 -out server.key 1024
Create a certificate for the signature request (CSR):
$ openssl req -new -key server.key -out server.csr
Remove the required password when loading SSL-backed Nginx and using the above private key:
$ cp server.key server.key.org$ openssl rsa -in server.key.org -out server.key
Configure nginx to finally mark the certificate using the above private key and CSR:
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Modify the Nginx configuration file to include Newly marked certificate and private key:
server { server_name YOUR_DOMAINNAME_HERE; listen 443; ssl on; ssl_certificate /usr/local/nginx/conf/server.crt; ssl_certificate_key /usr/local/nginx/conf/server.key; }
Restart nginx. This can be accessed by: https://YOUR_DOMAINNAME_HERE You can also add the following code to implement port 80 redirect to 443
server {listen 80;server_name ww.centos.bz;rewrite ^(.*) https://$server_name$1 permanent;}
For beginner Linux (me too), I dont want to mess with Linux in the virtual machine, and I dont want
With the rapid development of the Internet, more and more people use computers to obtain information
The disk sector defaults to 512 bytes. To verify, execute it from the command line: fdisk -l
Tizen 1.0 was released, and Taize is a Linux-based open source software platform that runs on smartp
Linux system management and maintenance -zip/unzip command
Optimization (configuration file) in nginx instructions
View file call status under Linux system Shell command
WindowsXP shutdown failure full contact, Window XP operating system tutorial
The basic task of the crontab setting under Linux
Install libxml2 "bin/rm: cannot remove `libtoolT: No such file
The slow mail problem of sendmail under Linux host
Linux system capture command tcpdump use instance
Win7 tutorial - wireless network card virtual wireless routing to achieve shared Internet
Clever use U disk to upgrade win8.1 system graphic tutorial
What is DOTA? What is the game of DOTA?
Win10 computer can not connect to the wifi hotspot fault resolution
Windows 7 system protection, system image and plan backup difference
Win10 how to add a local account Win10 add a local account tutorial
Windows.old folder delete method
How does Win7 eliminate speaker current? How to eliminate the sound of the speaker current
Win10 Preview 10074: Official Content Fix and Known Issues at a Glance
Win8 card can not enter the desktop in the modern interface solution