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

  • Home
  • SEARCH
  • 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 8041215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:08:21+00:00 2026-06-05T04:08:21+00:00

I followed a tutorial in Rails Casts: #335 Deploying to a VPS . I

  • 0

I followed a tutorial in Rails Casts: #335 Deploying to a VPS. I have a linode VPS set up with an Ubuntu 10.04 image and I can deploy to it. Now it’s serving:

/home/user0/first-rails-app/public (domain1.com) 

I want to use nginx to serve another rails app and a php app, asume they are stored here:

/home/user1/php-app/public (domain2.com)
/home/user2/another-rails-app/public (subdomain.domain1.com)

My nginx.conf

upstream unicorn {
  server unix:/tmp/unicorn.blog.sock fail_timeout=0;
}

server {
  listen 80 default deferred;
  # server_name example.com;
  root /home/user0/first-rails-app/public;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @unicorn;
  location @unicorn {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
}

All the domains and sub domain point to the server (x.x.x.x). I’m not sure how to use unicorn with two rails apps in the same server, even if I get virtual hosts correctly setup in nginx.conf.

Any suggestions where to start looking or what to modify?

Thanks!

  • 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-05T04:08:24+00:00Added an answer on June 5, 2026 at 4:08 am

    You just have to declare multiple upstreams in your conf

    upstream app1 { server unix:/tmp/app1.sock; }
    upstream app2 { server unix:/tmp/app2.sock; }
    
    server {
      server_name http://www.example.com
      location /foo {proxy_pass http://app1; break;}
      location /bar {proxy_pass http://app2; break;}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed a tutorial for sending email in Rails, and I have this in
I followed this tutorial: https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf However, I can't seem to set the path right.
I recently set up a new account with github. I'm following a Rails tutorial
I have followed this tutorial to configure apn_on_rails but I am getting the following
I am trying to use PDFKit using rails 3, I followed the railscast tutorial
I followed the Rails Tutorial on setting up automated tests with Guard and Spork
I've followed the Rails Tutorial up to the linked point. Here's the shell output:
I followed below tutorial and built one whole complete app. http://www.tonyamoyal.com/2010/07/28/rails-authentication-with-devise-and-cancan-customizing-devise-controllers/ http://www.tonyamoyal.com/2010/09/29/rails-authentication-with-devise-and-cancan-part-2-restful-resources-for-administrators/comment-page-2/#comment-879 All is
I am trying to run a Rails app on thin. I followed this tutorial
I've followed the tutorial available at http://railscasts.com/episodes/221-subdomains-in-rails-3 . It allows you to pass a

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.