Something Strange Re-Iterate

Hello

Seeing as I didn’t get a response from my last question. Let me a
different approach.

I followed an example config from this site:
http://topfunky.net/svn/shovel/nginx/conf/nginx.conf

Everything for the most part was clear except the part of the example
that states this:

Copy this section on down and put into a separate file

if you want to organize your virtual hosts in files.

Then include here with

include /usr/local/nginx/conf/vhosts/my_subdomain.conf

the server directive is nginx’s virtual host directive.

This part of the instruction wasn’t really clear as to where to put the
‘include’ statement. It says to copy everything, then include here?!?!
I have no idea what that means.

So inevitably I ended making my main nginx.conf look like this

http {
.
.
.

Rename to mongrel_site1, mongrel_site2, etc if using

virtual hosts.

upstream mongrel {
server 127.0.0.1:5000;
# server 127.0.0.1:5001;
# server 127.0.0.1:5002;
}

/usr/local/nginx/conf/vhosts/my_subdomain.conf
.
.
.
}

Then I created a file called ‘my_subdomain.cong’ (in the path of
course), as a test just to see if it works with part of the example that
say “copy from here down”.

So my first question is; Is the above correct, or, am i supposed to put
the ‘include’ within the upstream method?

Example:

upstream mongrel {
server 127.0.0.1:5000;
# server 127.0.0.1:5001;
# server 127.0.0.1:5002;
/usr/local/nginx/conf/vhosts/my_subdomain.conf
}

  • Shamunda

***** Email confidentiality notice *****

28/1/2009

This message is private and confidential. If you have recieved this
message in error, please notify us and remove it from your system.

On Wed, Jan 28, 2009 at 8:05 PM, Shamunda [email protected] wrote:

‘include’ statement. It says to copy everything, then include here?!?! I
upstream mongrel {

 server 127.0.0.1:5000;
 # server 127.0.0.1:5001;
 # server 127.0.0.1:5002;
 /usr/local/nginx/conf/vhosts/my_subdomain.conf

}

I think you forgot the “include” keyword.

Try

oh sorry that was a typo. I meant to put include there as
well…However my question is, is that where I’m supposed to put the
include statement? Or is it supposed to exist outside of the brackets?

-Sham


From: [email protected] on behalf of Rajeev J Sebastian
Sent: Wed 1/28/2009 9:47 AM
To: [email protected]
Subject: Re: Something Strange Re-Iterate

On Wed, Jan 28, 2009 at 8:05 PM, Shamunda [email protected] wrote:

‘include’ statement. It says to copy everything, then include here?!?! I
upstream mongrel {

 server 127.0.0.1:5000;
 # server 127.0.0.1:5001;
 # server 127.0.0.1:5002;
 /usr/local/nginx/conf/vhosts/my_subdomain.conf

}

I think you forgot the “include” keyword.

Try

upstream mongrel {
server 127.0.0.1:5000;
# server 127.0.0.1:5001;
# server 127.0.0.1:5002;
include /usr/local/nginx/conf/vhosts/my_subdomain.conf
}

***** Email confidentiality notice *****

28/1/2009

This message is private and confidential. If you have recieved this
message in error, please notify us and remove it from your system.

Can you post your whole config somewhere like http://www.pastie.org/ ?
That might help pinpoint it easier.

Ah cool…Ok

Here’s the Link to the main nginx.conf file:
http://www.pastie.org/373601

and here’s the link to one of my ‘include’ files for my virtual host:
include for cluster1: http://www.pastie.org/373608
include for cluster2: http://www.pastie.org/373611
include for cluster3: http://www.pastie.org/373613

Each host has a seperate directory; so cluster1 would be in directory of
…/cluster1 etc…etc… They all pretty much are the same except the ip
changes…

So the weird thing I’m experiencing is that if i only user the IP
address in “server_name” then all my includes always redirect to
cluster1…wtf…

but if for example I put fqdn in the cluster2 server_name: server_name
foo.foobar.com

then it works as it should, and cluster2 sticks to cluster2.

Any ideas why this would happen?

Thanks for your help.

Shamunda


From: [email protected] on behalf of jeff emminger
Sent: Wed 1/28/2009 3:22 PM
To: [email protected]
Subject: Re: Something Strange Re-Iterate

Can you post your whole config somewhere like http://www.pastie.org/ ?
That might help pinpoint it easier.

***** Email confidentiality notice *****

28/1/2009

This message is private and confidential. If you have recieved this
message in error, please notify us and remove it from your system.

On Wed, Jan 28, 2009 at 04:39:44PM -0500, Shamunda wrote:

So the weird thing I’m experiencing is that if i only user the IP address in “server_name” then all my includes always redirect to cluster1…wtf…

but if for example I put fqdn in the cluster2 server_name: server_name foo.foobar.com

then it works as it should, and cluster2 sticks to cluster2.

Any ideas why this would happen?

Have you seen:

http://marc.info/?l=nginx&m=123315533904205