One vhost takes over entire server

so this is the deal, i have a perferctly working nginx configuration

nginx.conf:
http://www.kiberpipa.org/~redduck666/nginx.conf
entire /etc/nginx/sites-enabled/
http://www.kiberpipa.org/~redduck666/nginx/sites-enabled

and than i try to add another vhost to the nginx server,
http://www.kiberpipa.org/~redduck666/nginx/ooocon.kiberpipa.org, when
i enable that vhosts no matter which site i request i get the content
of the ooocon site.

the same thing happens with
http://www.kiberpipa.org/~redduck666/nginx/bruc06.org

i am using nginx 0.5.32 downloaded from nginx.net.

On Mon, Oct 29, 2007 at 03:26:02PM +0100, Almir K. wrote:

i enable that vhosts no matter which site i request i get the content
of the ooocon site.

the same thing happens with
http://www.kiberpipa.org/~redduck666/nginx/bruc06.org

You need to add

   location / {
        proxy_pass http://127.0.0.1:81;
  •       proxy_set_host  Host  $host;
     }

On 10/29/07, Igor S. [email protected] wrote:

You need to add

   location / {
        proxy_pass http://127.0.0.1:81;
  •       proxy_set_host  Host  $host;
     }
    

thanks

(and it is ‘‘proxy_set_header Host $host;’’, just in
case someone will be looking at this thread facing same troubles)

anyone?

actually, it still doesn’t work, same problems.

this is what my two proxy codes look like:

            location / {
                    proxy_pass http://127.0.0.1:81;
                    proxy_max_temp_file_size 10M;
                    proxy_set_header   Host             $host;
                    proxy_set_header   X-Real-IP 

$remote_addr;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
}

On Tue, Oct 30, 2007 at 07:11:39PM +0100, Almir K. wrote:

anyone?

Actually, format you posted your configuration is difficult to
understand.

Is listen 10.0.0.2:80; is the same as listen dogbert:80; or not ?

I see some duplicate names in servers, for example, ooocon.kiberpipa.org
nginx should warn about duplicate names in log.

On 10/30/07, Igor S. [email protected] wrote:

Is listen 10.0.0.2:80; is the same as listen dogbert:80; or not ?

yes.

I see some duplicate names in servers, for example, ooocon.kiberpipa.org
nginx should warn about duplicate names in log.

right now oocon.kiberpipa.org is served by lighttpd (as you see they
are proxied back to 127.0.0.1:81), i’m trying to make nginx serve it,
i did the following two things:

  • removed the domain from server_name in the lighttpd proxy file
  • enabled the ooocon.kiberpipa.org vhost (which is currently disabled)

when i do that no matter which domain i try to access (out of those
server by that server off course) i always get the ooocon website.

On Tue, Oct 30, 2007 at 08:45:38PM +0100, Almir K. wrote:

are proxied back to 127.0.0.1:81), i’m trying to make nginx serve it,
i did the following two things:

  • removed the domain from server_name in the lighttpd proxy file
  • enabled the ooocon.kiberpipa.org vhost (which is currently disabled)

when i do that no matter which domain i try to access (out of those
server by that server off course) i always get the ooocon website.

I do not know what is “ooocon website”. There is no such name in your
configuration.

On 10/31/07, Igor S. [email protected] wrote:

I do not know what is “ooocon website”. There is no such name in your
configuration.

ooocon website == ooocon.kiberpipa.org :slight_smile:

anyone? please?

On Tue, 2007-11-06 at 16:19 +0100, Almir K. wrote:

anyone? please?

Can you shrink/rewrite your configuration up to the point where it still
exhibits the issue but is also more “testable” by other people on the
list ?

Do you have any error logged while starting nginx or during the
request ?

Can you setup nginx in debug mode (compile with --with-debug and run in
debug mode) and send to the list an extract of the log showing the
request in question that exhibits the problem ?

When I initially read your report, I thought that it was that you didn’t
had any default keyword in your listen.

Also does nginx complains about server_names_hash_bucket_size too low ?

And finally, note that oocoon.kiberpipa.org is in:
./01-proxy-za-lighttpd
and
ooocon.kiberpipa.org
which might be why you have some troubles…

Hope that helps,