Forum: NGINX Vhost problem (only last vhost works)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8ed45f7f2d23cc2ab08f78893a5feee8?d=identicon&s=25 Kyrre Nygård (kyrre)
on 2008-12-10 18:32
(Received via mailing list)
Hey you all, I'm trying to run 3 sites / virtual hosts:

http://pastie.org/335739

But only the last site works. The first and second redirects me to that
last site.

What have I done wrong?

Thank you.
F745d7fbe0dbe947aa1082aabb2b6a4f?d=identicon&s=25 Redd Vinylene (reddvinylene)
on 2008-12-10 19:34
(Received via mailing list)
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-12-10 20:08
(Received via mailing list)
On Wed, Dec 10, 2008 at 06:16:48PM +0100, "Kyrre Nyg?rd" wrote:

> Hey you all, I'm trying to run 3 sites / virtual hosts:
>
> http://pastie.org/335739
>
> But only the last site works. The first and second redirects me to that last site.
>
> What have I done wrong?

Are you sure that mongrel understands both variants: site1.com
and www.site1.com ?
F745d7fbe0dbe947aa1082aabb2b6a4f?d=identicon&s=25 Redd Vinylene (reddvinylene)
on 2008-12-10 20:29
(Received via mailing list)
On Wed, Dec 10, 2008 at 7:55 PM, Igor Sysoev <is@rambler-co.ru> wrote:
>
> Are you sure that mongrel understands both variants: site1.com
> and www.site1.com ?
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>

Hello Igor!

I've made an attempt improving my config files:

http://pastie.org/335986

All my sites, however, get a 502 Bad Gateway (nginx/0.6.34). Any idea
what's wrong?

Thanks!
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-12-10 20:33
(Received via mailing list)
On Wed, Dec 10, 2008 at 08:13:00PM +0100, Redd Vinylene wrote:

>
> Hello Igor!
>
> I've made an attempt improving my config files:
>
> http://pastie.org/335986
>
> All my sites, however, get a 502 Bad Gateway (nginx/0.6.34). Any idea
> what's wrong?

What is in error_log ?
F745d7fbe0dbe947aa1082aabb2b6a4f?d=identicon&s=25 Redd Vinylene (reddvinylene)
on 2008-12-10 21:28
(Received via mailing list)
On Wed, Dec 10, 2008 at 8:20 PM, Igor Sysoev <is@rambler-co.ru> wrote:
>
> What is in error_log ?
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>

Nothing, I got rid of the Bad Gateway problem by finetuning my
mongrel_cluster files I think. Here's my latest setup:
http://pastie.org/336024

The other problem remains though. Only site 3 seems to work. When I
visit site 1 and site 2 all I see is site 3.

Thanks!
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-12-10 21:38
(Received via mailing list)
On Wed, Dec 10, 2008 at 09:09:20PM +0100, Redd Vinylene wrote:

> On Wed, Dec 10, 2008 at 8:20 PM, Igor Sysoev <is@rambler-co.ru> wrote:
> >
> > What is in error_log ?
>
> Nothing, I got rid of the Bad Gateway problem by finetuning my
> mongrel_cluster files I think. Here's my latest setup:
> http://pastie.org/336024
>
> The other problem remains though. Only site 3 seems to work. When I
> visit site 1 and site 2 all I see is site 3.

When you ask site1.com and www.site1.com, in both cases you see site 3 ?
F745d7fbe0dbe947aa1082aabb2b6a4f?d=identicon&s=25 Redd Vinylene (reddvinylene)
on 2008-12-10 22:21
(Received via mailing list)
On Wed, Dec 10, 2008 at 9:24 PM, Igor Sysoev
>
> When you ask site1.com and www.site1.com, in both cases you see site 3 ?
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
>

Yes, that's exactly right. Why?
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-12-11 09:26
(Received via mailing list)
On Wed, Dec 10, 2008 at 10:07:17PM +0100, Redd Vinylene wrote:

> On Wed, Dec 10, 2008 at 9:24 PM, Igor Sysoev
> >
> > When you ask site1.com and www.site1.com, in both cases you see site 3 ?
>
> Yes, that's exactly right. Why?

Are you sure that mongrels on 127.0.0.1:5000/5001/5002 are able to
recoginze different hosts ? Can you see all sites without nginx ?
F745d7fbe0dbe947aa1082aabb2b6a4f?d=identicon&s=25 Redd Vinylene (reddvinylene)
on 2008-12-11 10:20
(Received via mailing list)
On Thu, Dec 11, 2008 at 9:12 AM, Igor Sysoev <is@rambler-co.ru> wrote:
>
> Are you sure that mongrels on 127.0.0.1:5000/5001/5002 are able to
> recoginze different hosts ? Can you see all sites without nginx ?
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
>

About mongrels recognizing different hosts, I'm not really sure. My
.yml files seem just like the ones in the tutorials though.

You mean if I can see them like this?

# sockstat | grep 500
www      ruby18     34817 3  tcp4   127.0.0.1:5008        *:*
www      ruby18     34814 3  tcp4   127.0.0.1:5007        *:*
www      ruby18     34811 3  tcp4   127.0.0.1:5006        *:*
www      ruby18     34807 3  tcp4   127.0.0.1:5005        *:*
www      ruby18     34804 3  tcp4   127.0.0.1:5004        *:*
www      ruby18     34801 3  tcp4   127.0.0.1:5003        *:*
www      ruby18     34797 3  tcp4   127.0.0.1:5002        *:*
www      ruby18     34794 3  tcp4   127.0.0.1:5001        *:*
www      ruby18     34791 3  tcp4   127.0.0.1:5000        *:*
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2008-12-11 10:33
(Received via mailing list)
On Thu, Dec 11, 2008 at 10:08:08AM +0100, Redd Vinylene wrote:

> # sockstat | grep 500
> www      ruby18     34817 3  tcp4   127.0.0.1:5008        *:*
> www      ruby18     34814 3  tcp4   127.0.0.1:5007        *:*
> www      ruby18     34811 3  tcp4   127.0.0.1:5006        *:*
> www      ruby18     34807 3  tcp4   127.0.0.1:5005        *:*
> www      ruby18     34804 3  tcp4   127.0.0.1:5004        *:*
> www      ruby18     34801 3  tcp4   127.0.0.1:5003        *:*
> www      ruby18     34797 3  tcp4   127.0.0.1:5002        *:*
> www      ruby18     34794 3  tcp4   127.0.0.1:5001        *:*
> www      ruby18     34791 3  tcp4   127.0.0.1:5000        *:*

Could you say mongrel to listen on host IP (not 127.0.0.1)
and request site1/etc directly from mongrel ?
F745d7fbe0dbe947aa1082aabb2b6a4f?d=identicon&s=25 Redd Vinylene (reddvinylene)
on 2008-12-11 11:00
(Received via mailing list)
On Thu, Dec 11, 2008 at 10:19 AM, Igor Sysoev <is@rambler-co.ru> wrote:
>
> Could you say mongrel to listen on host IP (not 127.0.0.1)
> and request site1/etc directly from mongrel ?
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>

Cool, well, going to http://<ip>:5000 (which should be site 1) shows
site 3. Thanks man!
F745d7fbe0dbe947aa1082aabb2b6a4f?d=identicon&s=25 Redd Vinylene (reddvinylene)
on 2008-12-11 13:41
(Received via mailing list)
I think the other sites actually work. However they all use site 3's
database for some strange reason. I've checked over and over and
they're all set to use their own databases. This is probably not a
nginx issue, so I'll try my luck elsewhere. Thanks a lot though!
Cb276709a5a157d541ea9c1f0af3af09?d=identicon&s=25 Timothy A. Napthali (Guest)
on 2008-12-13 00:49
(Received via mailing list)
I'm wondering if Nginx is going to get the ability to add, remove and
rewrite generic response headers?

At the moment you seem to be able to use "add_header" when the response
code is 200, 204, 301, 302 or 304 or modify the "expires" header but
what I would like to be able to do is muck about with authentication
headers. I'm trying to get Microsoft "Outlook Anywhere" (aka RPC over
HTTP) to work but one of the issues I'm having is negotiating
authentication away from NTLM (which wont work) to basic. I've seen this
done with Apache by doing response header rewrites to strip out the NTLM
stuff in a few examples.
This topic is locked and can not be replied to.