-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
101 lines (79 loc) · 2.29 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
worker_processes 1;
daemon off;
events { }
http {
# upstreams
server { listen 127.1.0.1; server_name localhost; location / { return 200 'X1\n'; } }
server { listen 127.2.0.1:10122; server_name localhost; location / { return 200 'X2\n'; } }
server { listen 127.3.0.1:10122; server_name localhost; location / { return 200 'X3\n'; } }
server { listen 127.4.0.1:10122; server_name localhost; location / { return 200 X4\n; } }
upstream H1 {
zone h2u 32k;
server 127.1.0.1:10122;
server 127.2.0.1:10122;
server www.example.com;
server 127.33.0.1:10122;
sticky cookie blah expires=3d;
}
resolver 8.8.8.8;
include "part.conf";
server {
listen 127.0.0.1:10122;
server_name localhost www.ru;
status_zone h1;
location ~ ^foo { proxy_pass http://H1/; }
location = /status.html { }
location /status { status; }
location /upstream_conf {
upstream_conf;
}
location /dumpcfg {
#config_info;
}
}
types {
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
text/html html;
}
upstream H12 {
zone h1u 32k;
server 127.3.0.1:10122;
server 127.4.0.1:10122;
}
server {
listen 127.0.0.3:10122;
server_name localhost;
server_name ^.*.uga.buga;
status_zone h1;
location / { proxy_pass http://H1/; }
location = /status.html { }
location /status { status; }
if ($http_user_agent ~ MSIE) {
rewrite ^(.*)$ /msie/$1 break;
}
if ($http_cookie ~* "id=([^;]+)(?:;|$)") {
set $id $1;
}
location ~ /issue([0-9]+) {
return 301 http://example.com/shop/issues/custom_isse_name$1;
}
}
map $http_host $name {
hostnames;
include "map.db";
default 0;
example.com 1;
*.example.com 1;
example.org 2;
*.example.org 2;
.example.net 3;
wap.* 4;
}
upstream 測試 {
zone h1u 32k;
server 127.3.0.1:10122;
server 127.4.0.1:10122;
}
}