Project

General

Profile

proxy: http://hostname/url1 => mod_proxy => http://hostname1:8080

Added by deceased about 15 years ago

Lighty Pros,

I want lighttpd to proxy requests that are on http://hostname/url1 to http://hostname1:8080 and not to http://hostname1:8080/url1

tried

$HTTP["url"] == "/url1" {
proxy.server = ( "" => (
( "host" => "192.168.0.1",
"port" => "8080" ) ) )
}

But it proxies everything to 192.168.0.1:8080/url1.

Appreciate your help.

Details:
OS: Debian GNU Linux squeeze
Lighttpd: 1.4.26-1.1

Config:

server.modules              = (
            "mod_access",
            "mod_alias",
            "mod_accesslog",
            "mod_compress",
            "mod_proxy",
)
ssl.engine = "enable" 
ssl.pemfile = "/etc/pki/CA/gal.pem" 
server.document-root       = "/var/www/" 
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog            = "/var/log/lighttpd/error.log" 
index-file.names           = ( "index.php", "index.html",
                               "index.htm", "default.htm",
                               "index.lighttpd.html" )

accesslog.filename         = "/var/log/lighttpd/access.log" 
url.access-deny            = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

server.pid-file            = "/var/run/lighttpd.pid" 

dir-listing.encoding        = "utf-8" 
server.dir-listing          = "enable" 

server.username            = "www-data" 
server.groupname           = "www-data" 

compress.cache-dir          = "/var/cache/lighttpd/compress/" 
compress.filetype           = ("text/plain", "text/html", "application/x-javascript", "text/css")

include_shell "/usr/share/lighttpd/create-mime.assign.pl" 
include_shell "/usr/share/lighttpd/include-conf-enabled.pl" 

$HTTP["remoteip"] =~ "127.0.0.1" {
        alias.url += (
                "/doc/" => "/usr/share/doc/",
                "/images/" => "/usr/share/images/" 
        )
        $HTTP["url"] =~ "^/doc/|^/images/" {
                dir-listing.activate = "enable" 
        }
}
$HTTP["url"] == "/url1" {
    proxy.server  = ( "" => (
                             ( "host" => "192.168.0.1",
                                "port" => "8080" ) ) )
}


Replies (2)

RE: proxy: http://hostname/url1 => mod_proxy => http://hostname1:8080 - Added by flagada15 almost 15 years ago

Hi !
I am looking for the same thing since long time and never find the solution!
You can see my topic here: http://redmine.lighttpd.net/boards/2/topics/1896
In case you find the solution please tell me!
Bye

    (1-2/2)