You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Amol Puglia <am...@yahoo.com> on 2013/02/21 12:44:48 UTC
[users@httpd] apache revealing the hostname of backend tomcat server.
Hello Team,
I am redirecting request from apache to backend server tomcat using mod_proxy_balancer.
The request is getting redirected but url is getting converted to backend server url.
For example :-
If apache web server url is http:\\server and backend server url is http:\\serverA.
when i access url http:\\server the request is redirecting to http:\\serverA but url is also getting changed and in browser it is showing http:\\serverA.
Kindly help me to resolve this issue.
Re: [users@httpd] apache revealing the hostname of backend tomcat server.
Posted by Amol Puglia <am...@yahoo.com>.
Hello Krist,
Thanks for your response.
After correcting application configuration, Load balancing is working fine.
Thanks
Amol Puglia
________________________________
From: Krist van Besien <kr...@gmail.com>
To: users@httpd.apache.org; Amol Puglia <am...@yahoo.com>
Sent: Thursday, February 21, 2013 6:21 PM
Subject: Re: [users@httpd] apache revealing the hostname of backend tomcat server.
On Thu, Feb 21, 2013 at 12:44 PM, Amol Puglia <am...@yahoo.com> wrote:
> Hello Team,
>
> I am redirecting request from apache to backend server tomcat using
> mod_proxy_balancer.
>
> The request is getting redirected but url is getting converted to backend
> server url.
>
> For example :-
>
> If apache web server url is http:\\server and backend server url is
> http:\\serverA.
>
> when i access url http:\\server the request is redirecting to http:\\serverA
> but url is also getting changed and in browser it is showing http:\\serverA.
The server is doing exactly what you ask it to do. When you ask it to
"redirect" to another server it will respond to client requests by
telling the client to go get the content somewhere else. As a result
the browser then makes a new request and the URL in the address bar
changes.
If you want to hide the backend tomcat server what you need to do is:
a) proxy requests, not redirect them.
b) configure the tomcat server itself not to use its own URL, but that
of the proxy whenever generating a redirect.
HTH,
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bern, Switzerland
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] apache revealing the hostname of backend tomcat server.
Posted by Krist van Besien <kr...@gmail.com>.
On Thu, Feb 21, 2013 at 12:44 PM, Amol Puglia <am...@yahoo.com> wrote:
> Hello Team,
>
> I am redirecting request from apache to backend server tomcat using
> mod_proxy_balancer.
>
> The request is getting redirected but url is getting converted to backend
> server url.
>
> For example :-
>
> If apache web server url is http:\\server and backend server url is
> http:\\serverA.
>
> when i access url http:\\server the request is redirecting to http:\\serverA
> but url is also getting changed and in browser it is showing http:\\serverA.
The server is doing exactly what you ask it to do. When you ask it to
"redirect" to another server it will respond to client requests by
telling the client to go get the content somewhere else. As a result
the browser then makes a new request and the URL in the address bar
changes.
If you want to hide the backend tomcat server what you need to do is:
a) proxy requests, not redirect them.
b) configure the tomcat server itself not to use its own URL, but that
of the proxy whenever generating a redirect.
HTH,
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bern, Switzerland
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] apache revealing the hostname of backend tomcat server.
Posted by Amol Puglia <am...@yahoo.com>.
Hello Krist,
Thanks for your response.
After correcting application configuration, Load balancing is working fine.
Thanks
Amol Puglia
________________________________
From: Igor Cicimov <ic...@gmail.com>
To: users <us...@httpd.apache.org>; Amol Puglia <am...@yahoo.com>
Sent: Thursday, February 21, 2013 6:53 PM
Subject: Re: [users@httpd] apache revealing the hostname of backend tomcat server.
On Thu, Feb 21, 2013 at 10:44 PM, Amol Puglia <am...@yahoo.com> wrote:
Hello Team,
>
>
>I am redirecting request from apache to backend server tomcat using mod_proxy_balancer.
>
>
>The request is getting redirected but url is getting converted to backend server url.
>
>
>For example :-
>
>
>If apache web server url is http:\\server and backend server url is http:\\serverA.
>
>
>when i access url http:\\server the request is redirecting to http:\\serverA but url is also getting changed and in browser it is showing http:\\serverA.
>
>
>Kindly help me to resolve this issue.
You need ProxyPassReverse in that case. Example
<Location /tomcats/app1/>
ProxyPass balancer://tomcats/app1/ stickysession=jssesionid|JSESSIONID nofailover=On lbmethod=byrequests
ProxyPassReverse balancer://tomcats/app1/
Order Deny,Allow
Allow from all
</Location>
Re: [users@httpd] apache revealing the hostname of backend tomcat server.
Posted by Igor Cicimov <ic...@gmail.com>.
On Thu, Feb 21, 2013 at 10:44 PM, Amol Puglia <am...@yahoo.com> wrote:
> Hello Team,
>
> I am redirecting request from apache to backend server tomcat using
> mod_proxy_balancer.
>
> The request is getting redirected but url is getting converted to backend
> server url.
>
> For example :-
>
> If apache web server url is http:\\server and backend server url is
> http:\\serverA.
>
> when i access url http:\\server the request is redirecting to
> http:\\serverA but url is also getting changed and in browser it is showing
> http:\\serverA.
>
> Kindly help me to resolve this issue.
>
You need ProxyPassReverse in that case. Example
<Location /tomcats/app1/>
ProxyPass balancer://tomcats/app1/ stickysession=jssesionid|JSESSIONID
nofailover=On lbmethod=byrequests
ProxyPassReverse balancer://tomcats/app1/
Order Deny,Allow
Allow from all
</Location>