Lighttpd rewite url from specific client when using proxy
- by Edu
I need to send all CGI request to another server so I decided to use it with proxy. The problem is that I need to send the client IP to the server so I did the following configuration:
$HTTP["url"] =~ "cgi" {
$HTTP["remoteip"] =~ "^(.*)$" {
url.rewrite-once = ("^(.*)$" => "$1?myip=%1")
}
proxy.server = (
"" =>
(
( "host" => "XXX.XXX.XXX.XXX",
"port" => 80,
)
)
)
}
the problem is that its not rewriting the URL.