shopmanage.yohobuy.com.conf 2.44 KB
 server {
    listen      80;
    server_name shopmanage.yohobuy.com;
    #charset koi8-r;
    access_log  /Data/logs/nginx/access_shop_manage.yohobuy.com.log  fenxi;
    set $rewite 0;
    if ($http_x_client_proto = 'http') {
        set $rewite 1;
    }
    if ($http_x_forwarded_proto = 'http') {
        set $rewite 1;
    }
    if ($rewite = 1) {
        return 301  https://$host$request_uri ;
    }
    
    # nginx status check
    location = /status_check {
           default_type text/html;
           return 200  'shopmanage.yohobuy.com - server is ok!';  
    }
    
    location ^~ /platform/product/getRemoteImageUrlBySku {
        proxy_redirect off;
        proxy_pass  http://yohobuy-platform/platform/product/getRemoteImageUrlBySku;
        #proxy_set_header   Host   "shopmanage.yohobuy.com";
        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 /oldshops/ {
        rewrite ^/oldshops/(.*)$ /$1 break;
        proxy_redirect / /oldshops/;
        proxy_pass  http://yohobuy-shops;
        proxy_set_header   Host   "shops.yohobuy.com";
        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-shop-manage-gray;
        proxy_pass  http://yohobuy-shop-manage;
        proxy_set_header   Host   "shopmanage.yohobuy.com";
        proxy_set_header   X-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Forwarded-For $http_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
	#chunked_transfer_encoding off;
    }
    location /shops-proxy/ {
        proxy_redirect off;
        proxy_pass  http://yohobuy-shops;
        proxy_set_header   Host   "shops.yohobuy.com";
        proxy_set_header   X-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Forwarded-For $http_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }
    location ~* /(static|assets)/ {
        proxy_redirect off;
        proxy_pass  http://yohobuy-shops;
        proxy_set_header   Host   "shops.yohobuy.com";
        proxy_set_header   X-Real-IP  $http_x_forwarded_for;
        proxy_set_header   X-Forwarded-For $http_x_forwarded_for;
        proxy_set_header   Accept-Encoding "gzip";
    }

}