Qustion for reverse-proxy for virtual host

Igor Sysoev is at rambler-co.ru
Tue Oct 6 12:16:50 MSD 2009


On Mon, Oct 05, 2009 at 04:00:23PM +0800, quan nexthop wrote:

> Hi all:
> 
> I try to setup the NGINX as a reverse-proxy to protect several webservers,
> which lots of websites are running on. Yes, it is a virtual host :)
> 
> abc.com |-----------[nginx reverse proxy] ------- |virtualhost] ----/abc
> directory
> 123.com|
> |--/123  directory
> 
> [note] the virtualhost port is 80.
> 
> I go through the wiki.nginx.net and can not find any configuration related
> with the topology.
> 
> Any one can paste a configuration for such case?
> how can I distinguish the different server in one listening port?

Probably you need

    server {
        server_name  abc.com;
        location / {
            proxy_pass  http://123.com/abc/;
        }
    }

    server {
        server_name  def.com;
        location / {
            proxy_pass  http://123.com/def/;
        }
    }


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





More information about the nginx mailing list