-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathexample.conf
110 lines (92 loc) · 4.75 KB
/
example.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
101
102
103
104
105
106
107
108
109
110
# Example mod_cdn configuration. Usually you'll want to put most of
# this within a specific VHost section, or even within a Location or
# Directory.
# Specify the authentication key (assigned by Voxel or set via the CDN
# portal) for generating and verifying authentication tokens. Note
# that in using mod_cdn's authentication capabilities, caution needs
# to be taken in changing the authentication key for the CDN host.
CDNAuthKey abc123
# Specify a URL to which a user will be redirected if a request for an
# object fails authentication (i.e., the auth token supplied with the
# request is incorrect).
CDNAuthAlt http://www.voxel.net
# Set the default expiration time in seconds for generated
# authentication tokens.
CDNAuthExpire 900
# Set the name of a query string argument that will be inserted into
# the query string of remapped URLs when the 'q' flag is set (or for
# every remapped URL if CDNHTMLAddIgnoreTokens is set). (What will
# actually be inserted is "voxignore=ignore" since VoxCAST currently
# expects the ignore token argument to include a value.)
CDNIgnoreTokenName voxignore
# Set the relative insertion point of the ignore token into the query
# string when the ignore token is being added to a remapped URL. The
# token is inserted either before or after some other query string
# argument. Here, we insert the ignore token before "random" in a
# query string, e.g. "?id=52&type=png&random=1220435841" becomes
# "?id=52&type=png&voxignore=ignore&random=1220435841"
CDNHTMLIgnoreTokenLocation before random
# By default, any relative links (e.g. "../blah.png") and locally
# absolute links ("/path/to/blah.png") that match a regex defined with
# CDNHTMLRemapURLServer will be CDNified. In addition, globally
# absolute links ("http://example.com/path/to/blah.gif") where the
# server name matches the current VHost's ServerName or one of its
# ServerAliases will be CDNified if they match. It may be the case
# that some of the content linked to in the HTML has URLs on a
# different server (e.g., "static.example.com"). CDNHTMLFromServers
# specifies a list of servernames for which we'll CDNify globally
# absolute links that match one of the regexes.
CDNHTMLFromServers static.example.com images.example.com
# Set the CDN hostname to which traffic will be redirected.
# This should be in the form of http[s]://xxxx.voxcdn.com[:port]
# but without any ending slash.
CDNHTMLToServer http://1234.voxcdn.com
# The main workhorse for CDNification via server remapping. Multiple
# instances of this directive can be used. If the regex matches a URL
# in the HTML, the URL is remapped to point to the
# CDNHTMLToServer. The flags affect the regex matching and the URL
# rewriting. Flags are individual letters, unseparated by any spaces,
# and include:
#
# * 'x': use POSIX extended regular expressions
# * 'i': ignore case in matching the regex
# * 'a': add authentication tokens to the query strings or
# matching URLS, based on CDNAuthKey
# * 'q': add query string ignore tokens to the query strings of
# matching URLs, based on CDNIgnoreTokenName and
# CDNHTMLIgnoreTokenLocation
# Remap all PNGs (without query strings), ignoring case and adding
# authentication tokens:
CDNHTMLRemapURLServer \.png$ ia
# Remap all PNGs with query strings, ignoring case, adding auth tokens,
# and adding "voxignore=ignore" before "random" in the query string:
CDNHTMLRemapURLServer \.png\? iaq
# Remap all GIFs and JPEGs, ignoring case:
CDNHTMLRemapURLServer \.gif$ i
CDNHTMLRemapURLServer \.jpe?g$ i
# Set the default expiration time in seconds for content that matches
# one of the CDNActAsOrigin regexes.
CDNDefaultExpire 86400
# The main workhorse for "originification", i.e., delivery of requests
# from the CDN for which the server running mod_cdn is the origin. The
# response for requests where the requested URL matches the regex are
# modified according to the flags. Flags include:
#
# * 'x': use POSIX extended regular expressions
# * 'i': ignore case in matching the regex
# * 'e': add an Expires header to the response. If the expiration-time
# value is set, this will be used to compute the time of expiration;
# otherwise, the value set with CDNDefaultExpire is used.
# * 'a': add a Vox-Authorization: required header to the response
# (with an alternative URL if specified by CDNAuthAlt), and verify
# that auth token is set and correct in the request's query string;
# if not, return a 403 response code.
# For requests for PNGs (ignoring case), require/verify authentication
# and add Expires headers with the default timeout:
CDNActAsOrigin \.png$ iae
# For requests for GIFs (ignoring case), add Expires headers with the
# default timeout:
CDNActAsOrigin \.gif$ ie
# For requests for JPEGs (ignoring case), add Expires headers with a
# timeout of one month:
CDNActAsOrigin \.jpe?g$ ie 2592000