Skip to content

lighttpd proxy

mmd edited this page May 7, 2018 · 4 revisions

Easy way to use cgimap + Rails port

JOSM: configure http://localhost:31337/api as API endpoint + run through OAuth setup steps

Use https://github.com/zerebubuth/openstreetmap-cgimap/blob/master/lighttpd.conf as a template, with the following changes:


server.modules = ( "mod_access", "mod_rewrite", "mod_fastcgi",  "mod_proxy" )

$HTTP["request-method"] == "GET" {
  url.rewrite-once = (
    "^/api/0\.6/map(\.json)?(\?(.*))?$" => "/dispatch.map",
    "^/api/0\.6/(node|way|relation)/[[:digit:]]+$" => "/dispatch.map",
    "^/api/0\.6/(node|way|relation)/[[:digit:]]+/history$" => "/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["url"] =~ "^/(?!dispatch\.map)" {
    proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "3000" ) ) )
}


Clone this wiki locally