Nginx: invalid host in upstream

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:

[email protected]:/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:

[email protected]:/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

From: “Reddirt” [email protected]

[email protected]:/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.

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

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: [email protected]:/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

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

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs