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 3934866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:45:53+00:00 2026-05-19T23:45:53+00:00

I want to run the same Rails 3 app at urls: davinci.local.dev:8081 davinci.testing.dev:8082 and

  • 0

I want to run the same Rails 3 app at urls: davinci.local.dev:8081 davinci.testing.dev:8082 and with environments development and testing, respectively.

I am using Nginx and passenger. My first attempt was:

server {
      listen 8081;
      server_name .davinci.local.dev;
      root /Users/Nerian/NetBeansProjects/DaVinci/DaVinci/public;
      passenger_enabled on;
      rails_env development;   
      #rails_env development
   }

server {
      listen 8082;
      server_name .davinci.testing.dev;
      root /Users/Nerian/NetBeansProjects/DaVinci/DaVinci/public;
      passenger_enabled on;
      rails_env test;   
      #rails_env development
   }

Yet when I browse to said urls, I get to the same deployment. If I first request the testing one, then it is that the app that is served always, whether I browse to davinci.local.dev or davinci.testing.dev. If I first request the development one, then it is that one which is served always.

Both deployments are using the same root app. Is there a way to make this works?

The objective is to serve the same app at different ENV in different domains.

  • 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-05-19T23:45:54+00:00Added an answer on May 19, 2026 at 11:45 pm

    I had a similar problem. I wanted a Rails application (named apparat) to have two nginx instances: example.eu for english version of the site and example.ee for estonian version. They share exactly the same functionality, so it makes sense to have just one code base for it (but I do have to make sure static assets like user-uploaded images won’t collide).

    server {
       listen 80;
       server_name example.eu;
       root /home/apparat/public;
       passenger_enabled on;
       rails_env apparat_eng;
    }
    
    server {
       listen 80;
       server_name example.ee;
       root /home/apparat/public;
       passenger_enabled on;
       rails_env apparat_ee;
    }
    

    However, similar to above, if I accessed example.ee, I got the example.eu instance of my Rails app. Possibly some quirk in nginx / passenger?

    Anyway I got around by making an arbitrary symlink to /home/apparat, for instance

    ln -s /home/apparat /home/apparat_eng
    ln -s /home/apparat /home/apparat_ee
    

    and changed the nginx config respectively

    server {
       listen 80;
       server_name example.eu;
       root /home/apparat_eng/public;
       passenger_enabled on;
       rails_env apparat_eng;
    }
    
    server {
       listen 80;
       server_name example.ee;
       root /home/apparat_ee/public;
       passenger_enabled on;
       rails_env apparat_ee;
    }
    

    So I’m able to trick nginx into thinking these are different directories.

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

Sidebar

Related Questions

Is there some way to run 2 threads at the same time? I want
I want to run an Apache on my local machine since I can only
I want to accomplish the same thing Rails has done, to store configurations in
i want to run the same query ten times. INSERT INTO items VALUES ('item_name')
I want to run the same set of Unix commands on multiple machines. I
I currently run my Rails app using: jruby --1.9 -J-XX:+CMSClassUnloadingEnabled -J-XX:+UseConcMarkSweepGC -J-XX:MaxPermSize=256m -S rails
I have 2 tomcat apps I want to run on the same server, is
I want to run a method, on the startup of the rails server. It's
I want run a script as follows: runner: ssh 'java program &' ssh 'java
Why this code don't work,when i want run this code vwd 2008 express show

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.