Do you put all your virtual host info in nginx.conf?

David GIbbons david at dgibbons.net
Wed Feb 18 11:12:25 MSK 2009


Doesn't seem any harder to me.

sed -i.bak 's/111.111.111.111/222.222.222.222/g' *.conf

-dg

Max wrote:
> I just wonder it will be more difficult if I want to change things for 
> multiple sites (multiple virtual conf files).  For example, if I want 
> to change ip from 111.111.111.111 to 222.222.222.222, I just open the 
> nginx.conf and so a search and replace, it will be replaced them all 
> at once. If it's in multiple virtual file, I need to open those 
> doamins which are using 111.111.111.111 and chagne them manually.
>
> On Wed, Feb 18, 2009 at 1:43 PM, Joe <frumentius at gmail.com 
> <mailto:frumentius at gmail.com>> wrote:
>
>     Yes, that's the best way to configure it.
>
>
>     On Wed, Feb 18, 2009 at 12:31 PM, Nick Pearson
>     <nick.pearson at gmail.com <mailto:nick.pearson at gmail.com>> wrote:
>
>         The best way is to include separate config files using the
>         include directive:
>         http://wiki.codemongers.com/NginxHttpMainModule#include
>
>         Nick
>
>
>         On Tue, Feb 17, 2009 at 11:22 PM, Max <maxbear at gmail.com
>         <mailto:maxbear at gmail.com>> wrote:
>
>             Hello,
>
>             Do you put all your virtual host info in nginx.conf? Since
>             I got a lot of virtual hosts, if I put all of them into
>             nginx.conf, I found it's rather big. Just want to know
>             what's the best practice to handle many virtual hosts. Thanks.
>
>             Max
>
>
>
>






More information about the nginx mailing list