-
Notifications
You must be signed in to change notification settings - Fork 10
/
nginx.conf
64 lines (48 loc) · 1.43 KB
/
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
pid logs/nginx.pid;
error_log logs/nginx-main_error.log debug;
# Development Mode
master_process off;
daemon off;
worker_processes 2;
events {
worker_connections 1024;
#use kqueue; # MacOS
use epoll; # Linux
}
http {
default_type text/plain;
types {
text/html html;
}
log_format main '[$time_local] $host "$request" $request_time s '
'$status $body_bytes_sent "$http_referer" "$http_user_agent" '
'cache_status: "$upstream_cache_status" args: "$args '
'sorted_args: "$sorted_querystring_args" ';
access_log logs/nginx-http_access.log;
proxy_cache_path /tmp/cache levels=1:2 keys_zone=zone:10m inactive=10d max_size=100m;
server {
listen 8080;
server_name localhost;
access_log logs/nginx-http_access.log main;
location /filtered {
sorted_querysting_filter_parameter v _ v time b;
proxy_set_header Host "static_files_server";
proxy_pass http://localhost:8081;
proxy_cache zone;
proxy_cache_key "$sorted_querystring_args";
proxy_cache_valid 200 1m;
}
location / {
proxy_pass http://localhost:8081;
proxy_cache zone;
proxy_cache_key "$sorted_querystring_args";
proxy_cache_valid 200 10m;
}
}
server {
listen 8081;
location / {
return 200 "$args\n";
}
}
}