Nginx强制https访问

server {
        listen 80;
        server_name centos.nginx.com;
        rewrite ^(.*) https://$server_name$1 permanent;
}
server {
        listen  443;
        server_name     centos.nginx.com;

        ssl on;
        ssl_certificate cert/ssl.crt;
        ssl_certificate_key cert/ssl.key;
        ssl_session_timeout 5m;
}

2014-1-24 11:31:17 通过网页

更换一道题!