yohobuywap.conf 1.45 KB


####################################################
### this is for  m.yohobuy.com
#####################################################
server {

    listen 80;
    server_name m.yohobuy.com *.m.yohobuy.com;

    root /Data/node/yohobuywap-node/current/yohobuywap-node/public/static;

    access_log /Data/logs/nginx/access_wap.yohobuy.com.log fenxi;
    error_log /Data/logs/nginx/error_wap.yohobuy.com.log warn;
    error_page 503 /503.html;
    if ($http_user_agent ~* "Scrapy") {

        return 403;
    }

    ######force https######
    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 ;
    }
    
    location  ^~ /activity/vip-day {
    return 301 http://m.yohobuy.com;
    }
 
 	# nginx status check
    location = /status_check {
           default_type text/html;
           return 200  'server is ok!';  
    }
    
  
      
   location ~* .(txt)$ {
        root /Data/node/yohobuywap-node/current/yohobuywap-node/public/static;
    }

    #cache config
    include vhosts/wap/cache.conf;

    #301 and idc
    include vhosts/wap/301.conf;
    #app
    include vhosts/wap/app.conf;
    #static
    include vhosts/wap/static.conf;

    #locations
    include vhosts/wap/locations.conf;

    location / {
        #proxy
        include vhosts/wap/node-proxy.conf;
    }
}