Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8365031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:34:00+00:00 2026-06-09T12:34:00+00:00

I’m somewhat confused about using Nginx and Thin for serving my Rails 3.2 app.

  • 0

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)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:34:01+00:00Added an answer on June 9, 2026 at 12:34 pm

    You are correct that you must start thin up on a new port due to the fact that nginx is already running on that port. It is generally best to start a server that is not the one that users should directly access on the loopback interface so that users can’t access it, therefore the command to start up thin should be something like:

    rails server thin -b 127.0.0.1 -p 3000 -e production
    

    After doing that, you should change your upstream block to be:

    upstream mywebapp_thin {
      server 127.0.0.1:3000;
    }
    

    That said, if you do not have multiple upstreams, you gain nothing by using the upstream module. You should just proxy_pass directly to your upstream. As it is, 0.0.0.0 is not a valid IP address, so that is likely why you are unable to access anything.

    I also notice that you do not have www.mywebserver.com or webserver.com in the server_name directive, not sure if you left that out on purpose.

    What does the error log say when you make a request? If these changes don’t fix your problems, you’ll probably need to post the error log as well as your full config.

    On a side note, if you are deploying on Windows, you might consider using JRuby and using trinidad as a server instead of thin, or using warbler to package your app so that it can be deployed on your Java application server of choice. This doesn’t change anything with your nginx configuration, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am reading a book about Javascript and jQuery and using one of the
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.