-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.nginx.conf
75 lines (54 loc) · 2.75 KB
/
example.nginx.conf
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
upstream upstream_example_tornado {
ip_hash;
server 127.0.0.1:8081;
}
upstream upstream_example_tornado_post_action {
ip_hash;
server 127.0.0.1:8081;
}
server {
listen 8080;
location / {
proxy_redirect off;
proxy_http_version 1.1;
include proxy_params;
proxy_pass http://upstream_example_tornado;
post_action @example_tornado_post_action;
add_header X-Request-Time $request_time;
add_header X-Upstream-Server $upstream_http_server;
add_header X-Upstream-Status $upstream_status;
add_header X-Upstream-Addr $upstream_addr;
add_header X-Upstream-Time $upstream_response_time;
add_header X-Upstream-Cache $upstream_cache_status;
add_header X-Upstream-Content-Type $upstream_http_content_type;
add_header X-Upstream-Location $upstream_http_location;
add_header X-Upstream-Random-Junk $upstream_http_random_junk;
}
location @example_tornado_post_action {
internal;
proxy_redirect off;
proxy_http_version 1.1;
#BASIC PROXY STUFFS
include proxy_params;
set $x_upstream_request_time $request_time;
set $x_upstream_http_server $upstream_http_server;
set $x_upstream_status $upstream_status;
set $x_upstream_addr $upstream_addr;
set $x_upstream_response_time $upstream_response_time;
set $x_upstream_cache_status $upstream_cache_status;
set $x_upstream_http_content_type $upstream_http_content_type;
set $x_upstream_http_location $upstream_http_location;
set $x_upstream_random_junk $upstream_http_random_junk;
proxy_set_header X-Response-Upstream-Request-Time $x_upstream_request_time;
proxy_set_header X-Response-Upstream-Server $x_upstream_http_server;
proxy_set_header X-Response-Upstream-Status $x_upstream_status;
proxy_set_header X-Response-Upstream-Addr $x_upstream_addr;
proxy_set_header X-Response-Upstream-Time $x_upstream_response_time;
proxy_set_header X-Response-Upstream-Cache $x_upstream_cache_status;
proxy_set_header X-Response-Upstream-Content-Type $x_upstream_http_content_type;
proxy_set_header X-Response-Upstream-Location $x_upstream_http_location;
proxy_set_header X-Response-Upstream-Random-Junk $x_upstream_random_junk;
proxy_set_header X-Post-Action 1;
proxy_pass http://upstream_example_tornado_post_action;
}
}