Welcome! Log In Create A New Profile

Advanced

Nginx + Thin config on Windows for Rails app

Edward Stembler
August 08, 2012 03:48PM
I'm somewhat confused about using Nginx and Thin for serving my Rails
3.2 app. Previously I had Thin serving my Rails app on Windows Server
2008 R2 without any issues. I would start Thin on the production server
specifying the server's IP address on port 80 like such:

rails server thin -b 10.xx.x.xxx -p 80 -e production

Now, I'm trying to add Nginx to the mix and I'm confused about how I
should start Thin and how I should configure Nginx to forward to Thin.

For example, now that Nginx is listening on port 80, should I start Thin
locally on a different port? Like 0.0.0.0:3000 (or 127.0.0.1:3000)? Or
do I start Thin like I did before on 10.xx.x.xxx:80?

In my Nginx conf file do I specify the upstream servers as localhosts,
or the machine's IP address? I'm not really sure what it's for.

upstream mywebapp_thin {
server 0.0.0.0:3000;
}

server {
listen 80;
server_name mywebserver www.mywebserver;
# locations et. al. excluded for brevity...

Most examples I see have the upstream servers running on ports 3000 or
5000. I'm wondering if those examples are really for a development
setup, and not production? Or does Thin need to run on a different port
other than 80 since Nginx is listening on it now?

I noticed that my web app does not respond to the basic urls
(mywebserver/projects) unless I add the port Thin is running on
(mywebserver:3000/projects)

StackOverflow link:
http://stackoverflow.com/questions/11849827/nginx-thin-config-on-windows-for-rails-app

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx + Thin config on Windows for Rails app

Edward Stembler August 08, 2012 03:48PM

Re: Nginx + Thin config on Windows for Rails app

Francis Daly August 08, 2012 07:42PM

Re: Nginx + Thin config on Windows for Rails app

Edward Stembler August 09, 2012 10:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 232
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready