forked from domoticz/domoticz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlighttpd.conf
61 lines (54 loc) · 2.03 KB
/
lighttpd.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
# A lighttpd config file for Domoticz, serving the UI as Static content and proying only API calls to Domoticz
#
# Make sure you set the Document-root to your full-path of the Domoticz WWW directory
#
# All calls to 'json.htm' will be proxied to the Domoticz webserver/webservice that is expected to run on port 8080 (No SSL)
# You can start Domoticz for example with the following config
# sudo ./bin/domoticz -www 8080 -wwwroot www -loglevel debug,error -debuglevel webserver
#
# Domoticz will show the (web)requests it handles (should be the json.htm ones only)
# And you can tail the lighttpd logfile (/tmp/lighttpd.log) to see all other static requests being handled by lighttpd
#
# Start this script from your Domoticz home directory with:
# lighttpd -D -f test/lighttpd.conf
#
# Now you can access Domoticz on port 8888 (http://localhost:8888)
server.document-root = "/home/vagrant/domoticz/www/"
server.port = 8888
accesslog.format = "%h %V %u %t \"%r\" %>s %b"
accesslog.filename = "/tmp/lighttpd.log"
index-file.names = ( "index.html" )
server.modules = (
"mod_indexfile",
"mod_accesslog",
"mod_rewrite",
"mod_proxy",
"mod_magnet"
)
mimetype.assign = (
".html" => "text/html;charset=UTF-8",
".txt" => "text/plain;charset=UTF-8",
".css" => "text/css;charset=UTF-8",
".js" => "text/javascript;charset=UTF-8",
".jpg" => "image/jpeg",
".png" => "image/png",
".json" => "application/json;charset=UTF-8"
)
# Handle the zipped Javascript files
$HTTP["url"] =~ ".js" {
url.rewrite-if-not-file = ( "^\/js\/(.*)\.js$" => "/js/$1.js.gz" )
magnet.attract-physical-path-to = ( "/home/vagrant/domoticz/test/lighttpd_gzippedjs.lua" )
}
# Handle the zipped language files
$HTTP["url"] =~ ".json" {
url.rewrite-if-not-file = ( "^\/i18n\/(.*)\.json$" => "/i18n/$1.json.gz" )
magnet.attract-physical-path-to = ( "/home/vagrant/domoticz/test/lighttpd_gzippedjson.lua" )
}
proxy.server = ( "/json.htm" =>
( "domoticzservice" =>
(
"host" => "localhost",
"port" => "8080"
)
)
)