Add reverse proxy example for lighttpd
Took a bit of tweaking to get the right config, particularly the url rewrite. Hence publishing this for others to see.
Note that this does not work with the current radicale 3.x.
Since "map-urlpath" of lighttpd maps in both directions, redirects from radicale result in a wrong url:
Trying to open "https://www.example.com/radicale/" in a browser results in "https://www.example.com/radicale/radicale/.web"
(/radicale/ --lighttpd--> / --radicale--> /radicale/.web --lighttpd--> /radicale/radicale/.web), which leads to 404/403-like errors.
Workaround: Remove the doubled path by rewrite:
server.modules += ( "mod_rewrite" )
url.rewrite-once = ( "^/radicale/radicale/(.*)" => "/radicale/$1" )
Complete example:
server.modules += ( "mod_proxy" , "mod_setenv", "mod_rewrite" )
$HTTP["url"] =~ "^/radicale/" {
proxy.server = ( "" => (( "host" => "127.0.0.1", "port" => "5232" )) )
proxy.header = ( "map-urlpath" => ( "/radicale/" => "/" ))
setenv.add-request-header = (
"X-Script-Name" => "/radicale",
)
url.rewrite-once = ( "^/radicale/radicale/(.*)" => "/radicale/$1" )
}
Thanks @rkoe - I've updated the PR