Nginx Proxy + Apache and php5 as apache module SERVER_ADDR problem (HELP!)

Igor Sysoev igor at sysoev.ru
Mon Oct 18 13:43:06 MSD 2010


On Mon, Oct 18, 2010 at 03:32:14AM -0400, DarkPepe wrote:

> Yes, I tryed that, but when using the external IP a weird error ocurrs.
> 
> It's kind of difficult to explain, but the website shows some random
> content from any of the scripts hosted in that particular virtualhost
> instead of showing the appropiate info.
> 
> Also other websites using different ips get mixed up with the website
> associated to that ip (EXTERNAL_IP_3)... 
> 
> For example:
> 
> EXTERNAL_IP_1 is associated with www.websiteA.com but, when configuring
> the upstream with EXTERNAL_IP_3, www.websiteA.com displays the info (the
> bugged info) of www.example.com (wich is associated to EXTERNAL_IP_3).
> 
> Probably that can be solved by using the correct IP for each virtualhost
> in proxy_pass (instead of http://apache) .. but eitherway, we still have
> the "bugged content" stuff there.

nginx can pass its address in HTTP header, you may try to use it on PHP side:

      proxy_set_header  X-Server-Address  $server_address;


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list