i think you only need one http {} for each specific http “instance”
you can have hundreds of server {} blocks inside of http {} - based on
the Host: header will answer. i only have one http {} block for
hundreds of sites. if nginx is listening on all interfaces it will use
the same instance.
i do have a second http {} block for a mogilefs webdav server, only
because of the separate http configuration needed.
On Sat, Aug 30, 2008 at 08:19:11PM -0700, mike wrote:
i think you only need one http {} for each specific http “instance”
you can have hundreds of server {} blocks inside of http {} - based on
the Host: header will answer. i only have one http {} block for
hundreds of sites. if nginx is listening on all interfaces it will use
the same instance.
i do have a second http {} block for a mogilefs webdav server, only
because of the separate http configuration needed.
I never tried several http {} blocks, and I’m not sure that it will
work correctly.
On Sun, Aug 31, 2008 at 03:03:05AM +0000, David wrote:
}
}
So each virtualhost has the same IP.
Will this work ok ? or do all virtualhosts need to be in their
own http {} section ?
You need the single http {} section with many server {} sections.
Inside server you may use any combinations of IPs, ports, and names,
they
should work as one may expect. If there are duplicates names on some IP,
nginx will warn you and ignore the duplicate.
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!
I am totally fine with just making an additional server {} block
instead of http {}
This is pretty much the only configuration option I’d want to change:
client_body_temp_path /var/mogdata/.tmp;
would this work? I guess the more I think about it I don’t care where
it puts the temp files… I just know that /var/mogdata/.tmp works
nicely for the mogilefs stuff.
So several http{} sections are not supported configuration.
That makes sense, this seemed logical because it was a different port.
It does seem to work though, but server {} allows for a different port
anyway, so I think I don’t even need it.
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.
location /dev4 {
root /var/mogdata/;
client_body_temp_path /var/mogdata/dev4/.tmp;
dav_methods put delete mkcol copy move;
dav_access user:rw group:rw all:r;
# not sure if this is needed
create_full_put_path on;
}
location /dev5 {
root /var/mogdata/;
client_body_temp_path /var/mogdata/dev5/.tmp;
dav_methods put delete mkcol copy move;
dav_access user:rw group:rw all:r;
# not sure if this is needed
create_full_put_path on;
}
on a server that does have two devices.
and i guess i answered a previous question - you could use a different
client_body_temp_path. funny how i already figured that out in the
last and forgot it (igor already told me a second time, but
apparently i had it figured out on my own)
so according to your config you don’t have the “create_full_put_path”
and it still works like a charm? i am not using mine in production
yet, i assume you are…
I did that example off the top of my head, but yes I do have
create_full_put_path enabled, it was more an example of using location
to enable the use of multiple devices in a config. The
client_body_temp_path is important if each location is at a separate
physical mount point otherwise you’ll run into nginx not writing data.