Mixed Virtualhosts and IP hosts

Igor Sysoev is at rambler-co.ru
Sun Aug 31 11:23:10 MSD 2008


On Sun, Aug 31, 2008 at 11:17:50AM +0400, Igor Sysoev wrote:

> On Sat, Aug 30, 2008 at 11:58:39PM -0700, mike wrote:
> 
> > On 8/30/08, Igor Sysoev <is at rambler-co.ru> wrote:
> > 
> > > I never tried several http {} blocks, and I'm not sure that it will
> > > work correctly.
> > 
> > really? works fine from my perspective - here's my config. seems to work great.
> > i thought that was the whole point, is you can have multiple services
> > as needed (http, imap or whatever, etc) - i guess i'd take any
> > optimization pointers, i'm always interested in simplifying
> > configurations and optimization!
> 
> You may use http and main sections in one configuraiton, but several http's
> are not intended by design. Probably they sould work, I will investigate.

I have found the case that will not work: in the following configuration
all requests to 80 port will go to one server only, despite the Host header:

http {
     server {
        listen 80;
        server_name  one;
     }
}

http {
     server {
        listen 80;
        server_name  two;
     }
}

So several http{} sections are not supported configuration.


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





More information about the nginx mailing list