Development, creation and creation of applications for rails

I am creating an application that, in addition to a live production environment, requires development and an intermediate environment. The production environment currently runs on its own instance of VPS. Record:

myapp.com  1.2.3.4

The development and middleware environment will be on its own instance of VPS. I set up the appropriate DNS records, so each environment has its own subdomain (A record in the myapp.com domain, pointing to the dev / staging server:

dev.myapp.com 5.6.7.8
staging.myapp.com 5.6.7.8

The Nginx console (Rails, Passenger) sets the root for each server (an SSL certificate is configured in the SSL configuration, and port 80 is redirected to port 443):

server {
   listen 443;
   server_name dev.myapp.com
   root /apps/myapp/dev/public
}

server {
   listen 443;
   server_name staging.myapp.com
   root /apps/myapp/staging/public
}

Rails, , , URL-:

staging.myapp.com
dev.myapp.com

, Capistrano , , dev URL ?

+5
1

, rails_env. :

server {
  listen 443;
  server_name staging.myapp.com;
  root /apps/myapp/staging/public;
  passenger_enabled on;
  rails_env staging;
}
+17

All Articles