Forum: NGINX nginx: invalid host in upstream

Posted by Reddirt (Guest)
on 2013-03-14 16:19
(Received via mailing list)
I'm trying to run a Rails app using Nginx with 5 Thin servers.

I created the thin.yml file and when I run the start command, I get:

bitnami@linux:/opt/bitnami/projects/ndeavor/current/config$ thin -C 
thin.yml
start

Starting server on 127.0.0.1:3000 ...

Starting server on 127.0.0.1:3001 ...

Starting server on 127.0.0.1:3002 ...

Starting server on 127.0.0.1:3003 ...

Starting server on 127.0.0.1:3004 ...

I created a ndeavor.conf file in nginx/conf/vhosts that looks like this:
https://dl.dropbox.com/u/35302780/ndeavor.conf

And if I run the command to start Nginx, I get this:

    bitnami@linux:/opt/bitnami$ sudo ./ctlscript.sh start nginx
    nginx: [emerg] invalid host in upstream "127.0.0.1:3000/ndeavor" in
/opt/bitnami/nginx/conf/vhosts/ndeavor.conf:2

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,237358,237358#msg-237358
Posted by unknown (Guest)
on 2013-03-14 16:25
(Received via mailing list)
From: "Reddirt" <nginx-forum@nginx.us>

>     bitnami@linux:/opt/bitnami$ sudo ./ctlscript.sh start nginx
>     nginx: [emerg] invalid host in upstream "127.0.0.1:3000/ndeavor" in
> /opt/bitnami/nginx/conf/vhosts/ndeavor.conf:2

What is your upstream section of the configuration file?  Do you have 
the
"/ndeavor" as part of the server statement?  Try taking it off.




Confidentiality Notice:
This electronic message and any attachments may contain confidential or
privileged information, and is intended only for the individual or 
entity
identified above as the addressee. If you are not the addressee (or the
employee or agent responsible to deliver it to the addressee), or if 
this
message has been addressed to you in error, you are hereby notified that
you may not copy, forward, disclose or use any part of this message or 
any
attachments. Please notify the sender immediately by return e-mail or
telephone and delete this message from your system.
Posted by Wolfsrudel (Guest)
on 2013-03-14 17:06
(Received via mailing list)
I don't think that you can use a path behind the server. The Upstream 
server
is a server name itself (with port), not with something like 
"/something" at
the end.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,237358,237364#msg-237364
Posted by Reddirt (Guest)
on 2013-03-14 19:20
(Received via mailing list)
It looks like Bitnami expects the Rails app to be in url/appname.  So, I
just removed the /ndeavor from the thin.yml and from nginx.conf.

This is what my thin.yml looks like now:
https://dl.dropbox.com/u/35302780/thin.yml

And this is my nginx.conf: https://dl.dropbox.com/u/35302780/nginx.conf

I'm using Bitnami Rails stack that runs Ubuntu.

I now start the Thin with this:  thin -C thin.yml start

And I start Nginx with this: bitnami@linux:/opt/bitnami$ sudo 
./ctlscript.sh
start nginx

And they both start OK.

But, when I go to my website url, I get this message "The service is not
available. Please try again later."

I don't know where that message is coming from.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,237358,237372#msg-237372
Posted by Reddirt (Guest)
on 2013-03-14 19:24
(Received via mailing list)
I restarted.  Now I'm getting the website without the CSS.  I thought 
Nginx
would provide the static webpages including CSS.

How can I tell if Nginx is running properly?

Sorry - This is my first time trying this.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,237358,237373#msg-237373
Posted by Reddirt (Guest)
on 2013-03-14 19:27
(Received via mailing list)
My Rails app has this in production.rb:    config.serve_static_assets =
false

When I run Thin by itself, I have to make that true.

I thought with Nginx it would stay false.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,237358,237374#msg-237374
Posted by Reddirt (Guest)
on 2013-03-14 21:14
(Received via mailing list)
OK - we can close this thread.  But, I'm going to start a new one 
because I
still can't get to my Rails app.

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,237358,237377#msg-237377
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.