nginx.test.web.yohobuy.com.conf 9.69 KB
server
{
    listen       80;
    server_name  www.yohobuy.com;
    root  /Data/PE/yohobuy-pc/yohobuy/www.yohobuy.com/public;

    # 频道相关
    location = / {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 = /kids {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 ^~ /common {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 ^~ /tools {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 = /signin.html {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 ^~ /logout.html {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 = /reg.html {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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/ {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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/register/ {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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/images/ {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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/back/ {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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/ {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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/autouserinfo/ {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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/thirdlogin/ {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 = /shopping/cart {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 ^~ /cart/index {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 / {
        proxy_redirect off;
        proxy_pass http://yohobuy-old-www;
        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 =/favicon.ico {
        expires    30d;
    }
    location =/crossdomain.xml {
        expires    30d;
    }
    location =/robots.txt {
        expires    1d;
    }
}

server
{
    listen       80;
    server_name  new.yohobuy.com;
    root  /Data/PE/yohobuy-pc/yohobuy/www.yohobuy.com/public;

    # 频道相关
    location = / {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 = /kids {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 ^~ /common {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 = /brands {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 ^~ /brands/plusstar {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 ^~ /brands/brandList {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 ^~ /brands/brandinfo {
        proxy_redirect off;
        proxy_pass http://yohobuy-pc;
        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 / {
        proxy_redirect off;
        proxy_pass http://yohobuy-old-new;
        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 =/favicon.ico {
        expires    30d;
    }
    location =/crossdomain.xml {
        expires    30d;
    }
    location =/robots.txt {
        expires    1d;
    }
}