Re: Need help to deal with poorly written PHP apps behind Apache used as Reverse Proxy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey Alan,

You are facing a very typical problem. I am not proficient
with mod_proxy_html, so I am not sure I can help you.

However, the best way is always to go and fix the
application. If you can not do that for whatever
reason, then mod_proxy_html is a good approach. A
more general approach is to work with mod_ext_filter.
See http://httpd.apache.org/docs/2.0/mod/mod_ext_filter.html
It has some nice examples. Needless to say, that this
is performance relevant and that this is evolving
into not very elegant hack.
I am not sure I understand what you are trying to
achieve with E=HTTP_HOST... In order to get this to your
application, you will have to set the http host header
explicitely with mod_header.

regs,

Christian


On Fri, Oct 19, 2007 at 01:54:07PM +0200, Alan AZZERA wrote:
> Hi world !
> 
> Here is my problem, I hope someone could help me.
> 
> I need to host some web apps, coded in PHP by non-professional developpers,
> and sometimes poorly written and designed. I use an Apache server configured
> as a Reverse Proxy, my real HTTP server is behind this R.P. I have two DNS
> zones, a public one and a private one. Here is the chain :
> 
>    1. Client's web browser asks for http://app.public.zone/
>    2. My Apache RP has a Virtual Host (ServerName app.public.zone) that
>    catches the request, and (reverse)proxifies it to
>    http://app.private.zone/
>    3. My Apache private server has a VirtualHost (Servername
>    app.private.zone) that handles the request.
> 
> Everything works fine with well coded and designed PHP apps, that make use
> of right Apache environment variables like HTTP_X_FORWARDED_(HOST|SERVER).
> But apps that make use of SCRIPT_URI, SERVER_NAME or HTTP_HOST cause
> troubles. I tried to handle these troubles with mod_proxy_html, but I failed
> to configure it to rewrite efficiently URL in CSS or JavaScripts. Desperate,
> I tried to handle this with mod_rewrite and its [E=HTTP_HOST:
> app.public.zone] feature in the VirtualHost app.private.zone. It failed too.
> 
> Do I miss something obvious ? Am I trying to solve problems the wrong way ?
> Since I am not far for being just a newbie, it is very possible... Would
> anyone be keen enough to put me on the right way ?
> 
> Best regards,
> 
> Al.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux