api_single.yoho.cn.conf 1 KB
## single http request, only forward to one data center (qcloud, e.g)
server {
	listen       80 ;
	server_name  api_single.yoho.cn  single.yoho.cn ;
    
	access_log  /Data/logs/nginx/api.single.yoho.cn_access.log  fenxi;
	error_log   /Data/logs/nginx/api.single.yoho.cn_error.log;


	set $real_ip "";
	set_by_lua_file $real_ip conf/setup.lua;
 
  if ( $request_method = HEAD ) {
     	 return 200;
    }
 
   # favourite
   location ^~  /favorite {
                proxy_redirect off;
                proxy_pass  http://brower/brower;
                proxy_set_header   X-Real-IP  $real_ip;
                proxy_set_header   X-Forwarded-For $remote_addr;
                proxy_http_version  1.1;
                proxy_set_header   Connection "";
    }

	
	# brower service
	location = / {
		proxy_redirect off;
		proxy_pass         http://apigateway/gateway;
		proxy_set_header   X-Real-IP  $real_ip;
		proxy_set_header   X-Forwarded-For $remote_addr;
		proxy_http_version  1.1;
		proxy_set_header   Connection "";
    }
}