Conflicting server name - i don't understand

Nuno Magalhães nunomagalhaes at eu.ipp.pt
Wed Sep 2 03:49:53 MSD 2009


I'm no expert, but may'be thi'll help...

On Tue, Sep 1, 2009 at 22:51, ktm<nginx-forum at nginx.us> wrote:
> This is my vhost file.Basically for every vhost i just copy this and change domain name. What i'm missing here, why if i add the second vhost it gives me that error ?

You have 3 servers{ }, not 2.

>  server {
>            listen   80;
>            server_name  www.xxx.com;
[...]
>       }

You can erase this one, and just use server_name xxx.com www.xxx.com;
in your next server entry:

> server {
>                        listen   80;
>                        server_name xxx.com; # <-- replace
[...]

The way you have it, you have two servers for the same domain. If i'm
not mistaken, that doesn't work correctly (and is unnecessary), unless
one server is taking incoming requests and the other is one of the
backend servers (thus using nginx's reverse proxy thingy).

>            location /  {
>                                root   /home/xxx/public_html/;

Are you making vhosts for the local users? something like
http://xxx.com/~username/ ? If so, did you check permissions?

There are a lot of ifs, maybe some can be replaced. Which version are
you running? Did you compile from source (if so with which parameters)
of install from a package? Which OS? If all else fails, you can start
with very basic configurations for your servers and add from there.

HTH,
Nuno Magalhães

-- 
()  ascii-rubanda kampajno - kontraŭ html-a retpoŝto
/\  ascii ribbon campaign - against html e-mail





More information about the nginx mailing list