1, the first configuration nginx and other plug-ins, this Google, a lot of configuration options. 2. Configure the server's certificate. The following steps are:[[email protected] ~]# cd /etc/pki/tls/certs [[email protected] certs]# make server.key umask 77 ; /usr/bin/openssl genrsa -aes128 2048 > server.keygenerating rsa private key, 2048 bit long modulus......................................................++++++.............++++++e is 61251 (0x10001) enter pass phrase:# set passphraseverifying - enter pass phrase:# confirm# remove passphrase from private key[[email Protected] certs]# openssl rsa -in server.key -out server.key enter pass phrase for server.key:# input passphrasewriting rsa key[[email protected] certs]#[[email protected] certs]# make server.csr umask 77 ; /usr/bin/openssl req -utf8 -new -key server.key -out Server.csryou are about to be asked to enter information that will be incorporatedinto your certificate request. what you are about to enter is what is called a Distinguished name or a dn. there are quite a few fields but you can leave some blankfor some fields there will be a default value,if you enter '. ', the field will be left blank.-----country name (2 letter code) [XX]:CN #countryState or Province Name (full name) [e]:Beijing #stateLocality Name (eg, city) [default city]: beijing #cityOrganization Name (Eg, company) [Default Company Ltd]:Test #companyOrganizational Unit Name (eg, section) []:Test Haha #departmentCommon Name (eg, your server ' S hostname) []:www.test.com #server ' s fqdnemail address []:[email protected] # email addressplease enter the following ' Extra ' attributesto be sent with your certificate requesta challenge password []:# enteran optional company name []:# Enter[[email protected] certs]#[[email protected] Certs]# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650Signature oksubject=/C=CN/ST=Beijing/L=Beijing/O=Test/OU=Test Haha/cn=www.test.com,/[email protEcted] getting private key[[email protected] certs]# chmod 400 server. * 3, configure the Nginx conf file #server {# listen 80;# server_name happy.cc.com;# rewrite ^ (. *) $ permanent;# }server { listen 80; listen 443 ssl; server_name happy.cc.com; location / { root /data/www/cloud; index index.html; } ssl on; ssl_certificate /data/webserver/nginx/conf/server.crt; ssl _certificate_key /data/webserver/nginx/conf/server.key; ssl_ session_timeout 5m; ssl_protocols sslv3 tlsv1; ssl_ciphers all:! Adh:! Export56:rc4+rsa:+high:+medium:+low:+sslv2:+exp; ssl_prefer_server_ ciphers on; #autoindex on; location = /favicon.ico { log_ not_found off; access_log off; } location ~ \.php$ { root /data/www/cloud; fastcgi_pass unix:/tmp/php-cgi.sock; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename /data/www/cloud$fastcgi_ script_name; include Fastcgi_params; } location ~ .*\. (gif|jpg|jpeg|png|bmp|swf) \$ { expires 30d; } location ~ .*\. (JS|CSS)?\$ { expires 1h; } access_log /data/log/ nginx/happy.access.log access; error_log /data/log/nginx/ Happy.error.log warn; }4, open the iptables 443 port
CentOS under Nginx Support HTTPS protocol