Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Squid reverse proxy and relative URL |
|
Author |
|
jnsunkersett
Joined: 30 Jan 2011 Posts: 23
|
Posted: Thu 10 May '12 7:13 Post subject: Squid reverse proxy and relative URL |
|
|
Hi,
The below is not related to Apache per se, so not sure if I am posting in the correct forum.
Beg your pardon (and approriate advice), if incorrect.
I have hosted a internet facing application.
I have a small issue in my production setup, in which I have used Squid Reverse proxy, to receive all requests coming from the internet.
In that, I have observed, I have to use fully qualifed URLs; I cannot use relative URLs.
Why?
Is this a must with squid reverse proxy?)
My prod setup, is as
(in DMZ) I use Squid 2.6 Stable 21, as a reverse proxy (RP) running on a Red Hat linux server
So all requests coming from the internet are resolved/ redirected/ forwarded to a web server (Apache HTTPD on a windows 2008).
Apache is further connected to JBoss (using AJP1.3)
In the squid RP config, is used
httpd_accel_host 10.0.1.9
So if client browses to https://www.mydomain.com, he hits my public IP, followed by squid RP which resolves/ forwards it to https://10.0.1.9/index.jsp; in which I do a relative redirecttion, viz.;
response.redirect("/landingPage.do");
which cannot be displayed to an external user as the fully qualified url is now;
https://10.0.1.9/landingPage.do
(squid access log, shows TCP_MISS/404)
So for a workaround, in my JSP, I do not use relative URLs but prefix the domain explicitly, viz.
response.redirect("https://www.mydomain.com" + "/landingPage.do");
* Is this a MUST?,
* or is something missing in my squid reverse proxy configuration?
PS: I do not face this issue in my UAT setup where I use Microsoft ISA as a reverse proxy server.
Any help will be greatly appreciated.
thanks in advance.
Jeevan |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 15 May '12 12:33 Post subject: |
|
|
my pure guessing for a solution or workaround.
edit the /etc/hosts file on the linux machine add
10.0.1.9 www.yourdomain.com
and than in the squid config
httpd_accel_host www.yourdomain.com
this is quessing without knowing
However, you should use a tool like firebug to trace the redirects. a) from internal and b) from external and see which server (squid or apache or jboss) adds that IP infront of the redirect. |
|
Back to top |
|
|
|
|
|
|