forked from zaf/agitator
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample.conf
More file actions
136 lines (102 loc) · 3.91 KB
/
sample.conf
File metadata and controls
136 lines (102 loc) · 3.91 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
###############################
# AGItator sample config file #
###############################
#
# Config uses toml format: https://github.com/toml-lang/toml
#
# General settings #
# Proxy listening address, setting this to an empty string "" disables listening for AGI connections
listen = "0.0.0.0"
# Proxy listening port
port = 4573
# Proxy listening address for TLS, setting this to an empty string "" disables listening for TLS AGI connections
tls_listen = ""
# Proxy listening port for TLS
tls_port = 4574
# Controls whether the proxy verifies the remote server's certificate chain and host name on outbound TLS connections.
tls_strict = true
# TLS certs
tls_cert = "/path/to/my.pem"
tls_key = "/path/to/my.key"
# Add an extra 'x_fwd_for' AGI environment variable. This var contains the originating IP address and port
# of a client connecting through the proxy. It can contain a comma+space separated list of IP addresses and works
# as the 'X-Forwarded-For' HTTP header in similar scenarios.
fwd_for = false
# Connect timeout in seconds. This controls the time period after which a connection attempt
# will be aborted if not successful. It includes time needed for name resolution. Setting this to 0
# disables timing out.
con_timeout = 3
# Server timeout in seconds. Setting this to 0 disables timing out.
srv_timeout = 0
# Client timeout in seconds. Setting this to 0 disables timing out.
clt_timeout = 0
# Log output. Valid values: 'syslog', 'stderr' (default)
log = "stderr"
# Detailed log output
debug = false
# Number of threads. This sets the GOMAXPROCS() number. Leave as zero to have the Go runtime automatically set this.
threads = 0
# List of routes #
[[route]]
# Routing is done based on the AGI request ("agi_request" AGI environment variable) path.
# The following matches a request like: "agi://my.proxy.ip/myscript?par=foo"
path = "myscript"
# Routing mode: In failover, the default mode, first defined server will be used, if that is not
# available we will try the rest of the servers following the order they were defined in the conf.
# In balance mode connections are distributed equally between the list of servers and for each new connection
# the server with the fewer active connections will be tried first.
# In round-robin mode we cycle through the server list and send each new connection to the next server
# following the order they were defined in the conf.
mode = "balance"
# Regex used to extract attribute from request and create a session,
# if there is a session with attribute, request will be routed to it.
# Set it to empty "" to disable sessions.
session_attribute = "agi_uniqueid: (.+)"
# Session keep timeout in seconds. Sessions is cleaned every 10 seconds.
session_timeout = 30
# List of servers: If port is omitted the default AGI port 4573 is assumed.
# IPv6 addresses should be enclosed in square brackets "[::1]" following the go 'net'
# package notation: http://golang.org/pkg/net/#ResolveTCPAddr
[[route.host]]
addr = "agi.example.com" # Server's hostname or IP address
port = 4573 # Server's listening port
tls = false # Server supports AGI over TLS
max = 0 # Max allowed number of active sessions. Zero or negative values mean no limit.
[[route.host]]
addr = "secure.agi.example.com"
port = 4574
tls = true
max = 0
# Another example
# Sessions is disabled
[[route]]
path = "myagi"
mode = "round-robin"
session_attribute = ""
session_timeout = 30
[[route.host]]
addr = "127.0.0.1"
port = 4545
tls = false
max = 0
[[route.host]]
addr = "localhost"
port = 4546
tls = false
max = 0
# Optional wildcard rule. This rule matches all requests that didn't match any of the above rules.
[[route]]
path = "*"
mode = "failover"
session_attribute = "agi_uniqueid: (.+)"
session_timeout = 30
[[route.host]]
addr = "[::1]"
port = 4546
tls = false
max = 1024
[[route.host]]
addr = "127.0.0.1"
port = 4545
tls = false
max = 1024