Question about the use of proxy and rewrite.
Added by laforge almost 14 years ago
Good morning to all,
i have a small problem to use lighttpd, i have this situation
Internet => lighttpd (proxy) => tomcat server
I want that a url like http://www.interneturl.com/ will be translated to
http://www.interneturl.com/javaapp/ and forwarded to the tomcat server.
So the home page of the site is the webapp on the tomcat server.
I tried this configuration:
$SERVER["socket"] == ":80" {
$HTTP["host"] =~ "www.interneturl.com" {
$HTTP["url"] =~ "^/" {
url.rewrite-once = (
"^/(.*)$" => "/javaapp/$1"
)
proxy.server = (
"" => ( "javaapp" => ( "host" => "10.10.10.200", "port" => 8080 ) )
)
}
}
but not work...why???
The system is:
- Ubuntu 9.04
- Lighttpd 1.4.22
Replies (3)
RE: Question about the use of proxy and rewrite. - Added by nitrox almost 14 years ago
Because url.rewrite-once within an $HTTP["url"] conditional doesn´t work.
Stated very clear at mod_rewrite.
RE: Question about the use of proxy and rewrite. - Added by andzsinszan over 13 years ago
Sorry about reopening this thread,
but is there an 'official' solution for the proxy-by-url + rewrite-url problem?
I've been reading blogs and posts for hours,
and only the following non-trivial solutions came up...
a) using mod_proxy_core (but requires lighttpd 1.5)
b) running another lighttpd just to break up $HTTP["url"] and rewrite_mod incompatibility
c) doing rewrite at the back-end server
Do I miss something? Is there a trivial solution?
CentOS 5.5
lighttpd 1.4.28
my setup:
lighttpd1.4 --> Apache2.2
--> Tomcat6
RE: Question about the use of proxy and rewrite. - Added by nitrox over 13 years ago
Mentioned list of options seems to be complete.