Free public certificate can be obtained from the startcom website, url: https://startssl.com/, register an account, and then press Certificates Wizard steps to fill in the information
The next step is to fill in the CSR certificate information, you can download the Red Arrows at the StartComTool.exe generation, the production of CSR certificates will also generate a. Key's private key file, which is later used when configuring the Nginx certificate.
After the step is complete, view the list of Certificates in tool box-certificate list
Click Retrieve to download the certificate package, and then there are 4 files, which are the certificates used by different servers
Because my website server is using Nginx, so I only need nginxserver.zip, decompression is a CRT certificate file
The following is how to configure the certificate in the Nginx configuration file, where the. key file is the private key file that was generated before the CSR certificate was generated with StartComTool.exe
server {Listen 80;
CharSet Utf-8;
server_name domain_name; Location ~/\d+/.*\. (Jpg| Jpg|png| Png|gif| Gif|jpeg|
JPEG) {root/mnt/img01/;
Expires 7d;
} location ^~/images/{root/var/www/wap;
Expires 7d;
} location ^~/js/{root/var/www/wap;
Expires 7d;
} location ^~/css/{root/var/www/wap;
Expires 7d; } location ~ \. (html|jsp)
{Proxy_pass http://127.0.0.1:9202;
Location ^~/user/login.html{return https://$server _name$request_uri;
Location ^~/usercenter/index.html{return https://$server _name$request_uri;
Location ^~/venue/order-confirm.html{return https://$server _name$request_uri; } Location ^~/activity/order-confirm.html{return https://$server _name$request_uri;
} server {Listen 443;
server_name domain_name;
SSL on;
Ssl_certificate XXX.CRT;
Ssl_certificate_key Xxx.key;
Ssl_session_cache shared:ssl:20m;
Ssl_session_timeout 20m;
Location/{Proxy_set_header x-forwarded-host $host;
Proxy_set_header X-forwarded-server $host;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
#proxy_pass http://127.0.0.1:9202;
Proxy_pass Http://wap_tomcat;
Proxy_set_header X-forwarded-proto HTTPS;
#proxy_redirect off; }
}
This section configuration configured domain_name partial URI address need SSL authentication, return 301 way Jump, also can use redirect way
The SSL protocol layer for Tomcat is not configured here, and if required, the P12 certificate can be produced in Toolbox-create pkcs#12 (PFX) file on the StartCom Web site and then generated Keytool via JDK KeyStore