forked from cubicdaiya/ngx_dynamic_upstream
-
Notifications
You must be signed in to change notification settings - Fork 11
/
nginx.conf
80 lines (63 loc) · 1.26 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#user nobody;
worker_processes 4;
error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
upstream backends {
zone zone_for_backends1 128k;
dns_update 1s;
server 127.0.0.1:6001;
server 127.0.0.1:6002;
server localhost:6003;
}
upstream mail {
zone mail 128k;
dns_update 10s;
dns_ipv6 off;
server mail.ru;
}
upstream yandex {
zone yandex 128k;
dns_update 10s;
dns_ipv6 off;
server yeandex.ru;
}
upstream google {
zone google 128k;
dns_update 10s;
dns_ipv6 off;
server google.com;
}
server {
listen 6000;
location /dynamic {
allow 127.0.0.1;
deny all;
dynamic_upstream;
}
location / {
proxy_pass http://backends;
}
}
server {
listen 6001;
listen 6002;
listen 6003;
location / {
echo hello;
}
}
}
stream {
upstream amazon {
zone amazon 128k;
dns_update 10s;
dns_ipv6 off;
server amazon.com:80;
}
}