-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathdispatcher.any
278 lines (253 loc) · 8.57 KB
/
dispatcher.any
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# Each farm configures a set of load balanced renders (i.e. remote servers)
/farms
{
# First farm entry
/publish
{
# Request headers that should be forwarded to the remote server.
/clientheaders
{
# Forward all request headers that are end-to-end. If you want
# to forward a specific set of headers, you'll have to list
# them here.
"*"
}
# Hostname globbing for farm selection (virtual domain addressing)
/virtualhosts
{
# Entries will be compared against the "Host" request header
# and an optional request URL prefix.
#
# Examples:
#
# www.company.com
# intranet.*
# myhost:8888/mysite
"aem-publish.local"
}
# The load will be balanced among these render instances
/renders
{
/rend01
{
# Hostname or IP of the render
/hostname "127.0.0.1"
# Port of the render
/port "4503"
# Connect timeout in milliseconds, 0 to wait indefinitely
# /timeout "0"
}
}
# The filter section defines the requests that should be handled by the dispatcher.
#
# Entries can be either specified using globs, or elements of the request line:
#
# (1) globs will be compared against the entire request line, e.g.:
#
# /0001 { /type "deny" /glob "* /index.html *" }
#
# denies request "GET /index.html HTTP/1.1" but not "GET /index.html?a=b HTTP/1.1".
#
# (2) method/url/query/protocol/path/selectors/extension/suffix will be compared
# againts the respective elements of the request line, e.g.:
#
# /0001 { /type "deny" /method "GET" /url "/index.html" }
#
# denies both "GET /index.html" and "GET /index.html?a=b HTTP/1.1".
#
# (3) all elements of the request line can also be specified as regular expressions,
# which are identified by using single quotes, e.g.
#
# /0001 { /type "allow" /method '(GET|HEAD)' }
#
# allows GET or HEAD requests, or:
#
# /0002 { /type "deny" /extension '()' }
#
# denies requests having no extension.
#
# Note: specifying elements of the request line is the preferred method.
#
/filter
{
/0000 { /url "/*" /type "allow" }
# Deny external access to system console and CRX web application, using a regular expression
/0001
{
/type "deny"
/url '/(system|crx|admin)(/.*)?'
}
# allow access to logout
/0002 { /type "allow" /url "/system/sling/logout*" }
}
/0003 { /type "deny" /url "/top/secret/data" } # Used in Optimizer Experiments, Test #2
# The cache section regulates what responses will be cached and where.
/cache
{
# The docroot must be equal to the document root of the webserver. The
# dispatcher will store files relative to this directory and subsequent
# requests may be "declined" by the dispatcher, allowing the webserver
# to deliver them just like static files.
/docroot "/Library/WebServer/docroot/publish"
# Sets the level upto which files named ".stat" will be created in the
# document root of the webserver. When an activation request for some
# page is received, only files within the same subtree are affected
# by the invalidation.
/statfileslevel "0"
# Flag indicating whether to cache responses to requests that contain
# authorization information.
# This needs to be set to "1" for an author instance, as all requests
# to an author instance contain authorization information.
# One must ensure that the cache rules section below does not include
# resources with user specific information.
/allowAuthorized "0"
# Flag indicating whether the dispatcher should serve stale content if
# no remote server is available.
#/serveStaleOnError "0"
## A grace period defines the number of seconds a stale, auto-invalidated
## resource may still be served from the cache after the last activation
## occurring. Auto-invalidated resources are invalidated by any activation,
## when their path matches the /invalidate section above. This setting
## can be used in a setup, where a batch of activations would otherwise
## repeatedly invalidate the entire cache.
#/gracePeriod "2"
# The rules section defines what responses should be cached based on
# the requested URL. Please note that only the following requests can
# lead to cacheable responses:
#
# - HTTP method is GET
# - URL has an extension
# - Request has no query string
# - Request has no "Authorization" header (unless allowAuthorized is 1)
/rules
{
/0000
{
# Disallow any caching by default and subsequently allow caching
# for content that may be cached although requested with authorization
# information present in the request
/glob "*"
/type "deny"
}
/0005
{
# Allow caching of requests to /content
/glob "/content/*"
/type "allow"
}
/0006
{
# Allow caching of requests to /etc.clientlibs
/glob "/etc.clientlibs/*"
/type "allow"
}
/0007
{
# Allow caching of the favicon
/glob "/favicon.ico"
/type "allow"
}
/0008
{
# Allow caching of requests to /conf
/glob "/conf/*"
/type "allow"
}
}
# The invalidate section defines the pages that are "invalidated" after
# any activation. Please note that the activated page itself and all
# related documents are flushed on an modification. For example: if the
# page /foo/bar is activated, all /foo/bar.* files are removed from the
# cache.
/invalidate
{
/0000
{
/glob "*"
/type "deny"
}
/0001
{
# Consider all HTML files stale after an activation.
/glob "*.html"
/type "allow"
}
/0002
{
/glob "/etc/segmentation.segment.js"
/type "allow"
}
/0003
{
/glob "*/analytics.sitecatalyst.js"
/type "allow"
}
}
# The allowedClients section restricts the client IP addresses that are
# allowed to issue activation requests.
/allowedClients
{
# Uncomment the following to restrict activation requests to originate
# from "localhost" only.
#
/0000
{
/glob "*"
/type "deny"
}
/0001
{
/glob "127.0.0.1"
/type "allow"
}
}
# The ignoreUrlParams section contains query string parameter names that
# should be ignored when determining whether some request's output can be
# cached or delivered from cache.
#
# In this example configuration, the "utm_campaign" parameter will be ignored.
/ignoreUrlParams
{
/0001 { /glob "*" /type "deny" }
/0002 { /glob "utm_campaign" /type "allow" }
}
# Cache response headers next to a cached file. On the first request to
# an uncached resource, all headers matching one of the values found here
# are stored in a separate file, next to the cache file. On subsequent
# requests to the cached resource, the stored headers are added to the
# response.
# Note, that file globbing characters are not allowed here.
#/headers
# {
# "Cache-Control"
# "Content-Disposition"
# "Content-Type"
# "Expires"
# "Last-Modified"
# "X-Content-Type-Options"
# }
# Enable TTL evaluates the response headers from the backend, and if they
# contain a Cache-Control max-age or Expires date, an auxiliary, empty file
# next to the cache file is created, with modification time equal to the
# expiry date. When the cache file is requested past the modification time
# it is automatically re-requested from the backend.
# /enableTTL "1"
}
# The statistics sections dictates how the load should be balanced among the
# renders according to the media-type.
/statistics
{
/categories
{
/html
{
/glob "*.html"
}
/others
{
/glob "*"
}
}
}
}
}