Cross platform reverse proxy with lighttpd

Solution 1:

proxy.server do not take host as an argument, and "host" is a keyword, not a place to put your host here.

Try this:

$HTTP["host"] =~ "(www.)?somewebsite.com" {
 $HTTP["url"] =~ "^/myapp/" {
  url.rewrite-once = ("^/myapp/(.*)" => "/newapp/$1") # If you need to rewrite context.
  proxy.server  =  ( "" => ( "" => ("host" => "192.168.1.30", "port" => 80 )))
  }
}

Solution 2:

$HTTP["host"] =~ "(www.)?somewebsite.com" {
  $HTTP["url"] =~ "^/myapp/" {
    url.rewrite-once = ("^/myapp/(.*)" => "/newapp/$1")
  }
  $HTTP["url"] =~ "^/newapp/" {
    proxy.server  =  ( "" => ( "" => ("host" => "192.168.1.30", "port" => 80 )))
  }
}

Alternatively, you can use proxy.header with "map-urlpath" with lighttpd 1.4.46 and later. See https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModProxy