upstream www.xiexianbin.cn {
    server 127.0.0.1:8081;
    #server xiexianbin.github.io;
}

server {
    listen 80;
    server_name www.xiexianbin.cn;
    rewrite ^(.*) https://$server_name$1 permanent;
}

server {
    listen 80;
    server_name xiexianbin.cn;
    rewrite ^(.*) https://www.xiexianbin.cn permanent;
}

server {
    listen       443;
    server_name  www.xiexianbin.cn;
    ssl          on;
    #charset koi8-r;
    access_log logs/www.xiexianbin.cn.access.log main;

    ### SSL cert files ###
    ssl_certificate      /var/local/github/ssl/xiexianbin_cn/1_www.xiexianbin.cn_bundle.crt;
    ssl_certificate_key  /var/local/github/ssl/xiexianbin_cn/2_www.xiexianbin.cn.key;
    ### Add SSL specific settings here ###
    keepalive_timeout    60;


    location / {
        #root   html;
        #index index.html index.htm;
        proxy_pass http://www.xiexianbin.cn;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
        include /etc/nginx/conf.d/proxy.conf;
        proxy_set_header X-Forwarded-Proto https;
    }
}
