-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample1.dhall
More file actions
195 lines (190 loc) · 7.04 KB
/
Copy pathexample1.dhall
File metadata and controls
195 lines (190 loc) · 7.04 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
let ng = ../../package.dhall
let myLogger =
ng.log_format::{
, name = "mylogger"
, escape = Some ng.Escape.none
, format = "\$remote_addr - \$remote_user [\$time_local]"
}
let jsonLogger =
ng.log_format::{
, name = "jsonlogger"
, escape = Some ng.Escape.json
, format = "{\"remote_addr\":\$remote_addr}"
}
let mapLoggable =
ng.map::{
, variable = "http_host"
, name = "loggable"
, hostnames = True
, entries =
[ { mapKey = "foobar", mapValue = "barbaz" }
, { mapKey = "barbaz", mapValue = "3" }
]
}
let config =
ng.config::{
, daemon = Some False
, debug_points = Some ng.DebugPoints.abort
, lock_file = Some "/tmp/lock.tmp"
, master_process = Some True
, ssl_engine = Some "foossl"
, timer_resolution = Some ng.Interval::{ milliseconds = Some 100 }
, user = Some ng.user::{ user = "foo" }
, worker_aio_requests = Some 3
, worker_priority = Some -10
, worker_processes = Some (ng.worker_processes.Type.number 4)
, worker_cpu_affinity = Some ng.worker_cpu_affinity::{
, auto = Some True
, mask = Some "0110"
}
, worker_shutdown_timeout = Some ng.Interval::{ seconds = Some 10 }
, events = ng.events::{
, accept_mutex = Some True
, accept_mutex_delay = Some ng.Interval::{ milliseconds = Some 500 }
, debug_connection = Some "unix:"
, multi_accept = Some True
, worker_connections = Some 1024
}
, http = Some ng.http::{
, add_header =
[ ng.add_header::{ name = "X-Foo", value = "Bar", always = True } ]
, add_trailer = [ ng.add_trailer::{ name = "X-Baz", value = "Qux" } ]
, fastcgi_intercept_errors = Some False
, fastcgi_temp_file_write_size = Some (ng.Size.kilobytes 1024)
, gzip_min_length = Some 1000
, gzip_vary = Some False
, if_modified_since = Some ng.if_modified_since.exact
, index = Some [ "index.html", "index.php" ]
, lingering_close = Some ng.LingeringClose.on
, limit_rate = Some (ng.Size.kilobytes 100)
, log_format = [ myLogger, jsonLogger ]
, log_not_found = Some False
, map = [ mapLoggable ]
, map_hash_max_size = Some (ng.Size.megabytes 1)
, sendfile = Some True
, server =
[ ng.server::{
, access_log = Some ng.access_log::{
, buffer = Some (ng.Size.kilobytes 1024)
, flush = Some ng.Interval::{ hours = Some 3 }
, format = Some jsonLogger
, gzip = Some True
, gzipLevel = Some 9
, `if` = Some "\$loggable"
, path = Some "/tmp/bar.log"
}
, default_type = Some "foobar"
, fastcgi_intercept_errors = Some True
, fastcgi_store_access = Some ng.Permission._777
, gzip_min_length = Some 500
, gzip_vary = Some True
, index = Some [ "other.htm" ]
, limit_rate = Some (ng.Size.kilobytes 16)
, lingering_close = Some ng.LingeringClose.off
, listen =
[ ng.listen.address "localhost"
, ng.listen.addressPort "foobar.com" 420
, ng.listen.port 8000
, ng.listen.unixPath "/tmp/unix.sock"
, ng.listen.type.Address
ng.listen.Address::{
, address = "dhall-lang.org"
, port = Some 9001
, ipv6only = Some True
, setfib = Some 1000
}
]
, location =
[ ng.location::{
, access_rules =
[ ng.deny "10.11.12.13"
, ng.allow "10.11.12.0/24"
, ng.deny "all"
]
, add_header =
[ ng.add_header::{
, name = "X-Country"
, value = "Sweden"
, always = True
}
]
, add_trailer =
[ ng.add_trailer::{ name = "X-Continent", value = "Europe" } ]
, default_type = Some "text/html"
, fastcgi_param =
[ ng.fastcgi_param::{
, parameter = "SCRIPT_FILENAME"
, value = "\$document_root\$fastcgi_script_name"
}
]
# ng.helpers.fastcgi_params
, fastcgi_pass = Some "unix:/tmp/fastcgi.socket"
, gzip_min_length = Some 200
, gzip_vary = Some False
, index = Some [ "foobar.html" ]
, internal = Some {=}
, limit_rate = Some (ng.Size.kilobytes 4)
, lingering_close = Some ng.LingeringClose.always
, log_not_found = Some True
, log_subrequest = Some True
, max_ranges = Some 512
, modifier = ng.location.modifier.exact
, try_files = Some ng.try_files::{
, files = [ "foo", "bar" ]
, uri = "=404"
}
, uri = "/"
}
, ng.location::{
, default_type = Some "foo"
, fastcgi_intercept_errors = Some True
, log_subrequest = Some True
, max_ranges = Some 512
, msie_padding = Some False
, modifier = ng.location.modifier.regexCaseInsensitive
, uri = "^/users/(.+\\.(?:gif|jpe?g|png))\$"
}
, ng.location::{
, default_type = Some "bar"
, log_subrequest = Some False
, max_ranges = None Natural
, msie_padding = Some True
, uri = "@bar"
}
]
, log_not_found = Some False
, root = Some "/var/root"
, satisfy = Some ng.satisfy.all
, server_name = [ "hello.net", "there.com" ]
, tcp_nodelay = Some True
, try_files = Some ng.try_files::{
, files = [ "index.html", "test.php" ]
, uri = "/foo"
}
}
]
, types = Some (toMap { fruits = [ "apple", "banana" ] })
, default_type = Some "text/html"
, upstream =
[ ng.upstream::{
, name = "django"
, ntlm = Some {=}
, server =
[ ng.upstream.server::{
, address = "localhost"
, fail_timeout = Some ng.Interval::{ minutes = Some 4 }
}
]
}
]
}
, load_modules =
[ "modules/ngx_mail_module.so", "modules/ngx_http_geoip_module.so" ]
, pcre_jit = Some True
, pid = Some "pidfile"
, error_log = Some ng.error_log::{
, file = "/tmp/error.log"
, level = Some ng.LogLevel.warn
}
}
in ng.config.make 0 config