Apache Lounge


About Forum Index Downloads Search Register Log in RSS X

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



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.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Squid reverse proxy and relative URL

Joined: 30 Jan 2011
Posts: 23

PostPosted: Thu 10 May '12 7:13    Post subject: Squid reverse proxy and relative URL Reply with quote


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.

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


So if client browses to https://www.mydomain.com, he hits my public IP, followed by squid RP which resolves/ forwards it to; in which I do a relative redirecttion, viz.;


which cannot be displayed to an external user as the fully qualified url is now;

(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.

Back to top
James Blond

Joined: 19 Jan 2006
Posts: 7334
Location: Germany, Next to Hamburg

PostPosted: Tue 15 May '12 12:33    Post subject: Reply with quote

my pure guessing for a solution or workaround.

edit the /etc/hosts file on the linux machine add www.yourdomain.com

and than in the squid config

httpd_accel_host www.yourdomain.com

this is quessing without knowing Wink

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

Reply to topic   Topic: Squid reverse proxy and relative URL View previous topic :: View next topic
Post new topic   Forum Index -> Other Software