server {
listen 80;
server_name www.zhuige.com zhuige.com;
rewrite ^/(.*) https://www.zhuige.com/$1 permanent;
#access_log /data/wwwlogs/www.zhuige.com_nginx.log combined;
#index index.html index.htm index.php;
#include /usr/local/nginx/conf/rewrite/thinkphp.conf;
#root /data/wwwroot/www.zhuige.com;
#if ($host != www.zhuige.com) {
#    rewrite ^/(.*)$ $scheme://www.zhuige.com/$1 permanent;
#    }
#
#location ~ \.php {
#    #fastcgi_pass remote_php_ip:9000;
#    fastcgi_pass unix:/dev/shm/php-cgi.sock;
#    fastcgi_index index.php;
#    include fastcgi_params;
#    set $real_script_name $fastcgi_script_name;
#        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
#        set $real_script_name $1;
#        #set $path_info $2;
#        }
#    fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
#    fastcgi_param SCRIPT_NAME $real_script_name;
#    #fastcgi_param PATH_INFO $path_info;
#    }
#location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
#    expires 30d;
#    access_log off;
#    }
#location ~ .*\.(js|css)?$ {
#    expires 7d;
#    access_log off;
#    }
}

server {
listen 443;
server_name www.zhuige.com zhuige.com;
ssl on;
ssl_certificate /usr/local/nginx/sslkey/203881467430089.pem;
ssl_certificate_key /usr/local/nginx/sslkey/203881467430089.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
access_log /data/wwwlogs/www.zhuige.com_nginx.log combined;
index index.html index.htm index.php;
include /usr/local/nginx/conf/rewrite/thinkphp.conf;
root /data/wwwroot/www.zhuige.com;
if ($host != www.zhuige.com) {
    rewrite ^/(.*)$ $scheme://www.zhuige.com/$1 permanent;
    }

location ~ \.php {
    #fastcgi_pass remote_php_ip:9000;
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    set $real_script_name $fastcgi_script_name;
        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
        set $real_script_name $1;
        #set $path_info $2;
        }
    fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
    fastcgi_param SCRIPT_NAME $real_script_name;
    #fastcgi_param PATH_INFO $path_info;
    }
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
    expires 30d;
    access_log off;
    }
location ~ .*\.(js|css)?$ {
    expires 7d;
    access_log off;
    }
}
