You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by Br...@csiro.au on 2012/03/07 23:16:26 UTC
Running click behind an Apache proxy
Hi
I have just started using Click - excellent framework. I have an application up and running but I have run into an issue running the application behind a proxy. This article sets out how a proxy is setup - http://www.apachetutor.org/admin/reverseproxies. I have followed these instructions to test this locally but the application fails in two ways. The html resource urls are broken - using mod_proxy_html fixes this but I consider that a hack. The redirects fail. Apache Wicket appears to address the whole issue, according to this article - https://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html - I am currently using the SpringClickServlet but, it doesn't appear to have anything like contextpath.
Thanks
Brad
Brad Lee
Research Projects Officer | Tasmanian ICT Centre
Information and Communication Technologies Centre
Phone: +61 3 6232 5510 | Fax: +61 3 6232 5229 | Mobile: 0432 992 469
brad.lee@csiro.au<ma...@csiro.au> | www.csiro.au | www.csiro.au/science/TasICTCentre.html | http://www.ict.csiro.au/staff/brad.lee/
Castray Esplanade, Battery Point, Hobart, TAS
GPO Box 1538, Hobart TAS 7001, Australia
The Tasmanian ICT Centre is jointly funded by the Australian Government through the Intelligent Island Program and CSIRO. The Intelligent Island Program is administered by the Tasmanian Department of Economic Development, Tourism and the Arts.
PLEASE NOTE
The information contained in this email may be confidential or privileged. Any unauthorised use or disclosure is prohibited. If you have received this email in error, please delete it immediately and notify the sender by return email. Thank you. To the extent permitted by law, CSIRO does not represent, warrant and/or guarantee that the integrity of this communication has been maintained or that the communication is free of errors, virus, interception or interference.
Please consider the environment before printing this email.
RE: Running click behind an Apache proxy
Posted by Br...@csiro.au.
Thanks Fredrik. The problem occurs when the proxy is not limited to the domain (I hope the terminology is correct), e.g. http://my.domain.com/xxxxx/myapp
I am using Apache Httpd and Tomcat.
As always, talking to someone helps!
The following https.cong configuration works:
ProxyPass /xxxxx/myapp http://myserver:8080/xxxxx/myapp
ProxyPassReverse /xxxxx/myapp http://myserver:8080/xxxxx/myapp
ProxyPassReverseCookiePath /xxxxx/myapp /
I found that I also needed to change the tomcat server.xml configuration as well:
<Context docBase="myapp" path="/xxxxx/myapp" reloadable="true"/>
Thanks again!
Brad
-----Original Message-----
From: Fredrik Jonson [mailto:fredrik@jonson.org]
Sent: Friday, 9 March 2012 7:30 AM
To: user@click.apache.org
Subject: Re: Running click behind an Apache proxy
Brad.Lee@csiro.au wrote:
> I have just started using Click - excellent framework. I have an
> application up and running but I have run into an issue running the
> application behind a proxy.
I have used Click in environments where Tomcat runs on localhost and is fronted by apache httpd, proxied through mod_proxy. There is nothing particular to Click that makes it more or less suitable for that kind of configuration than any other web framework.
Basically all you need is something like this:
ProxyPass /clickapp http://localhost:8080/clickapp ProxyPassReverse /clickapp http://localhost:8080/clickapp
Can you post the relevant parts of your site configuration in Apache?
I assume Apache Httpd and Tomcat, but maybe that isn't your setup?
BTW, I do not recall ever needing to use mod_proxy_html, if you use relative url:s - and I belive click does that by default - you won't have any absolut urls in the html documents that needs rewriting.
--
Fredrik Jonson
Re: Running click behind an Apache proxy
Posted by Fredrik Jonson <fr...@jonson.org>.
Brad.Lee@csiro.au wrote:
> I have just started using Click - excellent framework. I have an
> application up and running but I have run into an issue running the
> application behind a proxy.
I have used Click in environments where Tomcat runs on localhost and is
fronted by apache httpd, proxied through mod_proxy. There is nothing
particular to Click that makes it more or less suitable for that kind of
configuration than any other web framework.
Basically all you need is something like this:
ProxyPass /clickapp http://localhost:8080/clickapp
ProxyPassReverse /clickapp http://localhost:8080/clickapp
Can you post the relevant parts of your site configuration in Apache?
I assume Apache Httpd and Tomcat, but maybe that isn't your setup?
BTW, I do not recall ever needing to use mod_proxy_html, if you use relative
url:s - and I belive click does that by default - you won't have any absolut
urls in the html documents that needs rewriting.
--
Fredrik Jonson