-
Notifications
You must be signed in to change notification settings - Fork 38
/
lighttpd.conf
92 lines (77 loc) · 2.76 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
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
# default document-root
server.document-root = "/home/matt/Programming/openstreetmap/cgimap/"
# TCP port
server.port = 31337
server.reject-expect-100-with-417 = "disable"
# selecting modules
server.modules = ( "mod_access", "mod_rewrite", "mod_fastcgi", "mod_proxy", "mod_alias" )
# handling unknown routes
server.error-handler-404 = "/dispatch.map"
# include, relative to dirname of main config file
#include "mime.types.conf"
# read configuration from output of a command
#include_shell "/usr/local/bin/confmimetype /etc/mime.types"
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)
#debug.log-request-handling = "enable"
$HTTP["request-method"] == "GET" {
url.rewrite-once = (
"^/api/0\.6/map(\.(json|xml))?(\?(.*))?$" => "/dispatch.map",
"^/api/0\.6/(node|way|relation)/[[:digit:]]+(\.(json|xml))?$" => "/dispatch.map",
"^/api/0\.6/(node|way|relation)/[[:digit:]]+/history.*$" => "/dispatch.map",
"^/api/0\.6/(node|way|relation)/[[:digit:]]+/[[:digit:]]+.*$" => "/dispatch.map",
"^/api/0\.6/(node|way|relation)/[[:digit:]]+/relations$" => "/dispatch.map",
"^/api/0\.6/node/[[:digit:]]+/ways$" => "/dispatch.map",
"^/api/0\.6/(way|relation)/[[:digit:]]+/full$" => "/dispatch.map",
"^/api/0\.6/changeset/[[:digit:]]+.*$" => "/dispatch.map",
"^/api/0\.6/(nodes|ways|relations)(\?(.*))?$" => "/dispatch.map",
"^/api/0\.6/changeset/[[:digit:]]+/download$" => "/dispatch.map",
)
}
$HTTP["request-method"] == "POST" {
url.rewrite-once = (
"^/api/0\.6/changeset/[[:digit:]]+/upload.*$" => "/dispatch.map",
)
}
$HTTP["request-method"] == "PUT" {
url.rewrite-once = (
"^/api/0\.6/changeset/[[:digit:]]+/close.*$" => "/dispatch.map",
"^/api/0\.6/changeset/[[:digit:]]+$" => "/dispatch.map",
"^/api/0\.6/changeset/create.*$" => "/dispatch.map",
)
}
$HTTP["url"] =~ "^/(?!(dispatch\.map))" {
proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "3000" ) ) )
}
#fastcgi.debug = 1
fastcgi.server = ( ".map" =>
(( "socket" => "/tmp/map-fastcgi.socket",
"bin-path" => "/home/matt/Programming/openstreetmap/cgimap/openstreetmap-cgimap",
"docroot" => "/",
"min-procs" => 1,
"max-procs" => 1,
"check-local" => "disable",
"bin-environment" => (
"CGIMAP_HOST" => "localhost",
"CGIMAP_DBNAME" => "apidb",
"CGIMAP_LOGFILE" => "/home/matt/Programming/openstreetmap/cgimap/log",
"CGIMAP_USERNAME" => "api",
"CGIMAP_PASSWORD" => "pass"
# "CGIMAP_UPDATE_HOST" => "127.0.0.1",
# "CGIMAP_UPDATE_DBNAME" => "openstreetmap"
)
))
)
# For use with Dockerfile
#
# fastcgi.server = ( ".map" =>
# (( "host" => "127.0.0.1",
# "port" => 8000,
# "check-local" => "disable",
#
# ))
# )