yohobuypc_node443.conf 4.2 KB
  #https flag, 1 means HTTPS, 0 means HTTP
     set $httpsFlag 1;

     location = / {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }

    location = /woman {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }

     location = /girls {
         return 301 /woman;
     }
        
     location = /kids {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }

     location = /lifestyle {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }
    
     location ^~ /product/sale/ {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }
    
     location ^~ /product/outlets/ {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }
    
     location = /passport/autosign/wechat {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }
 
     location ^~ /passport/login/wechat/ {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }

     location = /guide {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }

     location = /getbrandFloorDataAjax  {
         if ($httpsFlag = 0) {
             return 301 http://$host$request_uri;
         }

        proxy_redirect off;
        proxy_pass http://yohobuy-node;
        proxy_set_header   Host   $host;
        proxy_set_header   X-Real-IP  $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }