Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to configure lighttpd (v1.5) as a reverse proxy. Gollum is running on port 8080 and I've setup lighttpd.conf as per the following:

$HTTP["url"] =~ "^/wiki.*" {
    proxy-core.protocol = "http"
    proxy-core.backends = ("")
    proxy-core.rewrite-request = ("_uri" => ("^/wiki(.*)" => "/$1"))
    proxy-core.rewrite-response = ("_url" => ("^/(.*)" => "/wiki/$1"))

Requests are being forwarded fine, but links are not being rewritten. The situation appears similar to lighttpd 1.5 reverse-proxy to trac in so much as browsing to

loads the page, but without any of it's resources (CSS, etc.) and following a link does not include the /wiki infix, e.g.:

How do the rewrite rules work in this situation?

share|improve this question
Can you clarify what you're intending the rewrite rules to do (original URL, rewritten URL examples)? Seems like the ? in the request rule is intended to be a /. – Shane Madden Oct 13 '11 at 22:46
Sorry, the ? was a typo. To confirm, I'd like to be able to browse to which is a proxy to a service running on Original URLs on that service are like:, which I'd like rewritten to – tlvince Oct 14 '11 at 14:38
Oh, gotcha. The response rewrite unfortunately only translates redirection URLs in the headers - those found in the response code aren't translated. If the wiki's links are sending to absolute locations (with a leading slash), then unfortunately, you can't have lighttpd take care of it for you - you'll need to wrangle the application into sending the correct references in its content. – Shane Madden Oct 14 '11 at 17:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.