-
Notifications
You must be signed in to change notification settings - Fork 27
/
lighttpd.conf.sample
209 lines (188 loc) · 7.28 KB
/
lighttpd.conf.sample
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
#--------------------------------------------------------------------
#
# This is a sample configuration file for the Lighttpd server for
# Give A Minute / Change By Us
#
# Instructions:
# * NEVER NEVER NEVER store passwords or keys in this file. This is a EXAMPLE!!
# * Copy this file to lighttpd on the production / deployed server
# * In your copy, change all <XXXX> values to what is specific to your server
# * diff, opendiff, diffmerge, windiff are your friends
# * If on Mac, uncomment "server.event-handler" line
#
#--------------------------------------------------------------------
# Location and User
#--------------------------------------------------------------------
# Where specific directories are and what user runs this.
#
#--------------------------------------------------------------------
var.username = "<YOUR_USERNAME>"
var.groupname = "<YOUR_GROUP>"
#--------------------------------------------------------------------
# When running locally, this should work fine, but depending on
# the environment, this may need to be absolute paths.
#
#--------------------------------------------------------------------
var.pidfile = "./run/lighttpd.pid"
var.docroot = "./"
var.errorlog = "./logs/main.log"
var.accesslog = "./logs/access.log"
var.binpath = "./main.py"
var.cachedir = "./run/cache"
# Mac specific even handling
#--------------------------------------------------------------------
# Enable the following line for OSX. Otherwise leave it disabled.
#
#--------------------------------------------------------------------
# server.event-handler = "freebsd-kqueue"
# Server settings
#--------------------------------------------------------------------
# Various server settings.
#
#--------------------------------------------------------------------
server.port = 8080
server.pid-file = var.pidfile
server.username = var.username
server.groupname = var.groupname
server.document-root = var.docroot
server.errorlog = var.errorlog
accesslog.filename = var.accesslog
# Server modules
#--------------------------------------------------------------------
# Modules needed for server
#
#--------------------------------------------------------------------
server.modules = (
"mod_expire",
"mod_rewrite",
"mod_alias",
"mod_access",
"mod_fastcgi",
"mod_accesslog",
"mod_auth",
"mod_compress"
)
# Fast CGI settings
#--------------------------------------------------------------------
# Settings for Fast CGI.
#
#--------------------------------------------------------------------
fastcgi.server = ("/main.py" =>
(( "socket" => "/tmp/fastcgi.socket",
"bin-path" => var.binpath,
"max-procs" => 1,
"bin-environment" => (
"REAL_SCRIPT_NAME" => ""
),
"check-local" => "disable"
))
)
# Authentication
#--------------------------------------------------------------------
# Enable the following if web server level authentication is
# desired.
#
#--------------------------------------------------------------------
# auth.debug = 2
# auth.backend = "htpasswd"
# auth.backend.htpasswd.userfile = "<AUTH_FILE>" # something/.lighttpd.htpasswd
# auth.require = ("/" => ("method" => "basic",
# "realm" => "Password protected area",
# "require" => "valid-user")
# )
# File Compression
#--------------------------------------------------------------------
# Enable file compression
#
#--------------------------------------------------------------------
compress.allowed-encodings = ("bzip2", "gzip", "deflate")
compress.cache-dir = var.cachedir
compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml")
# Expires Headers
#--------------------------------------------------------------------
# Set a long cache expiration for static content
#
#--------------------------------------------------------------------
$HTTP["url"] =~ "^/static/" {
expire.url = ( "" => "access 1 years" )
}
# File handling
#--------------------------------------------------------------------
# File settings
#
#--------------------------------------------------------------------
index-file.names = ("index.php", "index.html", "index.htm", "default.htm")
static-file.exclude-extensions = (".php", ".pl", ".fcgi", ".py")
url.access-deny = ("~", ".inc", ".log", ".yaml", ".conf")
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
url.rewrite-once = (
"^/images/(.*)" => "/data/giveaminute/images/$1",
"^/crossdomain.xml$" => "/static/util/crossdomain.xml",
"^/robots.txt$" => "/static/util/robots.txt",
"^/favicon.ico$" => "/static/util/favicon.ico",
"^/css/(.*)$" => "/static/css/$1",
"^/img/(.*)$" => "/static/img/$1",
"^/js/(.*)$" => "/static/js/$1",
"^/swf/(.*)$" => "/static/swf/$1",
"^/static/(.*)$" => "/static/$1",
"^/xml/(.*)$" => "/static/xml/$1",
"^/(.*)$" => "/main.py/$1"
)
mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jar" => "application/x-java-archive",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar",
# default mime type
"" => "application/octet-stream",
)