Nginx reverse proxy with IP-Based vhosts apache

Jamie Quint jsquintz at gmail.com
Mon Jan 21 03:03:05 MSK 2008


I am aware of this, however the problem I am having is that apache can not
differentiate because it sees everything coming from nginx as
127.0.0.1(localhost). Thus the only way it works is if I do the
following...
<VirtualHost 127.0.0.1:8080>
    .....
</VirtualHost>

When in reality I want something like this...

<VirtualHost 77.77.66.66:8080>
    .....
</VirtualHost>

<VirtualHost 77.77.66.65:8080>
    .....
</VirtualHost>

<VirtualHost 77.77.66.64:8080>
    .....
</VirtualHost>

Which I cannot do without having some way to get the IP from behind nginx.

~Jamie

On Jan 18, 2008 11:56 AM, propanbutan <propanbutan at gmx.net> wrote:

> "Jamie Quint" wrote:
> > If I use apache's name based virtual hosts everything works out great,
> > however if I use IP based virtual hosts, apache does not direct to
> > the right virtual host, instead just defaulting to the main Document
> > Root. I can't seem to find an answer on Google anywhere, so any
> > feedback is greatly appreciated (relevant part of nginx.conf below).
>
> Hi,
> for name based virtual hosts, a web server uses the request Host header
> to decide which virtual host to dispatch to.
> When you use IP based virtual hosts, you need to set them up to listen
> on different ports and/or ip addresses. If you don't, apache has no way
> of knowing which virtual host is the right one, just like you describe.
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080120/ac5a045e/attachment.html>


More information about the nginx mailing list