Discussion:
Informing Tomcat of proxy base URL?
Andy Buckley
2007-03-01 13:04:10 UTC
Permalink
I have a Tomcat server providing an application via an Apache proxy.
User HTTP requests to http://myserver.example.com/server/ on port 80 get
mapped by the proxy to http://localhost:8082, which is set up as a valid
Tomcat provider for Apache. So far so good.

However, I've noticed problems using Tapestry and DWR (though I don't
think they're responsible for the problem), where auto-generated paths
from Tomcat apps will look like /foo/bar - this works fine if pointing a
browser directly at Tomcat on port 8080, but since the proxy already has
a URL path prefix of /server/, these links don't work through the proxy
interface. Is there a standard way of informing Tomcat that when
accessed on port 8082 it should consider itself either to have a base
path starting with /server or to use a base URL of
http://myserver.example.com/server?

I've already seen references to mod_proxy_html as an Apache module which
can do some HTML URL re-writing, but I'm not sure if this is sufficient,
since JavaScript libraries like DWR seem to also get some base path
information from Tomcat and this is unlikely to be properly handled by
mod_proxy_html.

Any help would be very welcome - I hope there's a standard solution that
I've just been unable to find with Google!

Cheers,
Andy

---------------------------------------------------------------------
To start a new topic, e-mail: ***@tomcat.apache.org
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Andy Buckley
2007-03-03 14:49:46 UTC
Permalink
Thought I'd send this again in case anyone knows an answer - I suspect
that once a day's worth of posts have gone by, unanswered posts will
probably never be answered :)

If there's no mechanism for solving this (i.e. passing the proxy base
path to Tomcat), it'd be useful to know: I can always configure the
proxy such that there is no base path, but if I don't have to, it'd be
even better!

Cheers,
Andy
Post by Andy Buckley
I have a Tomcat server providing an application via an Apache proxy.
User HTTP requests to http://myserver.example.com/server/ on port 80 get
mapped by the proxy to http://localhost:8082, which is set up as a valid
Tomcat provider for Apache. So far so good.
However, I've noticed problems using Tapestry and DWR (though I don't
think they're responsible for the problem), where auto-generated paths
from Tomcat apps will look like /foo/bar - this works fine if pointing a
browser directly at Tomcat on port 8080, but since the proxy already has
a URL path prefix of /server/, these links don't work through the proxy
interface. Is there a standard way of informing Tomcat that when
accessed on port 8082 it should consider itself either to have a base
path starting with /server or to use a base URL of
http://myserver.example.com/server?
I've already seen references to mod_proxy_html as an Apache module which
can do some HTML URL re-writing, but I'm not sure if this is sufficient,
since JavaScript libraries like DWR seem to also get some base path
information from Tomcat and this is unlikely to be properly handled by
mod_proxy_html.
Any help would be very welcome - I hope there's a standard solution that
I've just been unable to find with Google!
Cheers,
Andy
---------------------------------------------------------------------
---------------------------------------------------------------------
To start a new topic, e-mail: ***@tomcat.apache.org
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Caldarale, Charles R
2007-03-03 14:56:34 UTC
Permalink
Subject: Re: Informing Tomcat of proxy base URL?
If there's no mechanism for solving this (i.e. passing the proxy base
path to Tomcat)
Can't say that I've tried it, but the doc speaks of using the proxyName
and proxyPort attributes on the appropriate <Connector> element:
http://tomcat.apache.org/tomcat-5.5-doc/proxy-howto.html
http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: ***@tomcat.apache.org
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org
Pid
2007-03-03 15:08:36 UTC
Permalink
Post by Caldarale, Charles R
Subject: Re: Informing Tomcat of proxy base URL?
If there's no mechanism for solving this (i.e. passing the proxy base
path to Tomcat)
Can't say that I've tried it, but the doc speaks of using the proxyName
http://tomcat.apache.org/tomcat-5.5-doc/proxy-howto.html
http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html
- Chuck
If the problem is in-page URLs then I'm not sure this will have much
effect. ProxyPassReverse has some effect on headers/cookies but I think
it leaves the body alone.

There is mod_proxy_html, a 3rd party module that does regexp based rewrites.

p
Post by Caldarale, Charles R
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
---------------------------------------------------------------------
To start a new topic, e-mail: ***@tomcat.apache.org
To unsubscribe, e-mail: users-***@tomcat.apache.org
For additional commands, e-mail: users-***@tomcat.apache.org

Loading...