Request a free HTTPS certificate https://login.wosign.com/reg.html
First check if Nginx has installed Http_ssl_module, I this is installed HTTPS module, if not this module requires Nginx smooth upgrade to add SSL to implement the station HTTPS.
can refer to http://www.open-open.com/lib/view/open1451624143370.html
Successful application will let you retrieve the certificate, my is Nginx, so the certificate natural selection for Nginx, upload to a folder under the server, Nginx folder below is the best choice, and then configure the nginx.conf file
Restart Lnmp Reload Try Https://www.usshare.cn
The description takes effect, but at this point HTTP can also access HTTPS, this is also necessary to do some settings, let its HTTP force jump to HTTPS
nginx Config http force jump to HTTPS (actually do a 301 jump)
Purpose: Force automatic jump to https://sdk.open.test.com/when accessing http://sdk.open.test.com/
Modify Nginx Site configuration file sdk.open.test.com.conf
Server
{
listen;
server_name sdk.open.test.com;
Return 301 https://$server _name$request_uri;
Rewrite ^/(. *) https://ssl.lanbing.org/$1 permanent; #关键代码仔细比较两者的跳转的区别
}
server
{
listen 443 SSL;
server_name sdk.open.test.com;
Index index.html index.htm index.php;
root/data/www/web/;
CharSet Utf-8;
Location ~.*\. (Swf|xml|mp3|png|jpg|gif|data) $ {
expires Max;
} location
~.*\. (CSS|JS|MX) $ {
expires 96h;
} Location-
/.svn/{
deny all;
} location
~. *\.php$
{
include fastcgi.conf;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Expires off;
}
SSL on;
SSL_CERTIFICATE/USR/LOCAL/NGINX/SSL/EA93BALK25XH3F9.CRT;
Ssl_certificate_key/usr/local/nginx/ssl/9yrt62bv1z4s35la.key;
Access_log/data/logs/sdk.open.test.com.access.log access;
Error_log /data/logs/sdk.open.test.com.error.log warn;
}
"detail Reference" Nginx enforces access to http://blog.csdn.net/wzy_1988/article/details/8549290 using HTTPS