Recently in the study nginx, the whole good encounter a demand is that the server and the client transfer between the content is encrypted, to prevent the middle of the leakage of information, but to the certificate service provider that the certificate is not cost-effective, because the access to the server are insiders, so they issued their own certificates, Ignore the browser's untrusted alerts. The following is the issuance certificate and configuration process.
First make sure the machine is installed with OpenSSL and Openssl-devel
InstallInstall Openssl-devel
Then you give yourself a certificate.
#cd/usr/local/nginx/1024x768#openssl req-new-key Server.key-outserver.csr#openssl RSA-in Server.key-365-inserver.csr-signkey server_nopwd.key-out server.crt
Now that the certificate has been generated, the following is the configuration Nginx
server { 443; SSL on; Ssl_certificate /usr/local/nginx/conf/server.crt; Ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key;}
Then restart the nginx.
#/usr/local/nginx/sbin/nginx-s Reload
To see if the port is open:
# lsof-i:443
PS: If "[Emerg] 10464#0:unknown directive" SSL "in/usr/local/nginx-0.6.32/conf/nginx.conf:74" is present, the SSL module is not compiled into Nginx, Configure the time to add "--with-http_ssl_module" can ^ ^
Now that the HTTPS server has been built, how do you let the browser trust the certificate that you issued?
Today, finally, the research has come out, as long as the previous generation of the Server.crt file imported into the system's certificate manager on the line, the specific method:
Publisher--Trusted Root Certification Authorities, content, Control Panel, Internet Options, import-Select SERVER.CRT
Using Nginx to build HTTPS server (GO)