-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.template
64 lines (60 loc) · 1.57 KB
/
config.template
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
{{ $listenport := .Listenport}}
{{ $domain := .Domain}}
daemon off;
events {
worker_connections 4000;
}
http {
client_body_temp_path /tmp/nginx_temp_body;
proxy_temp_path /tmp/nginx_temp_proxy;
fastcgi_temp_path /tmp/nginx_temp_fastcgi;
uwsgi_temp_path /tmp/nginx_temp_uwsgi;
scgi_temp_path /tmp/nginx_temp_scgi;
server_names_hash_bucket_size 64;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "http_x_forwarded_for"';
sendfile on;
tcp_nopush on;
tcp_nodelay off;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
server {
listen {{.Healthport}} default_server;
location =/health {
return 200;
access_log off;
}
location ~* {
return 404;
}
}
server {
listen {{$listenport}} default_server;
location ~* {
return 404;
}
}
{{range $server := .Servers}}
upstream {{$server.Name}} {
least_conn;
server {{$server.Name}}:{{$server.Port}};
}
server {
listen {{$listenport}};
server_name {{$server.Name}}{{$domain}};
client_max_body_size 10m;
location / {
proxy_pass http://{{$server.Name}};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
}
{{end}}
}
worker_processes 1;