api_single.yoho.cn.conf
1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## 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 "";
}
}