api.ufo.conf
1.72 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
server {
listen 80 default_server backlog=8192;
## for proxy
proxy_http_version 1.1;
proxy_set_header Connection "";
server_name 2.yohobuy.com ufoapi.yohoops.org;
access_log /Data/logs/nginx/ufo_access.log fenxi;
error_log /Data/logs/nginx/ufo_error.log;
set $real_ip "-";
set $request_api_method "-";
set $request_udid "-";
set $request_uid "-";
# set_by_lua_file $real_ip conf/setup.lua;
# access_by_lua_file 'conf/lua/limit_api_flow.lua';
#################### reject http HEAD & status check / .ico quest #########
# HEAD REQUEST RETURN 405
if ( $request_method = HEAD ) {
return 200;
}
# nginx status check
location = /status_check {
default_type text/html;
return 200 'server is ok!';
}
# cdn check
location = /test.html {
return 200;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
#################### begin match 2.yohobuy.com #########################
# location / {
# rewrite_by_lua_file conf/redirect.lua;
# }
#################### end match 2.yohobuy.com #########################
location / {
limit_req zone=limit_ufo burst=2 nodelay;
proxy_redirect off;
proxy_pass http://ufogateway/ufo-gateway/;
proxy_set_header X-Real-IP $real_ip;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
}
location ~* .(txt)$ {
root /Data/local/openresty-1.9.15.1/nginx/html;
}
}