I'm creating an app that in addition to the live production environment requires a development and staging environment. The production environment is currently live and on its own VPS instance. A record:
myapp.com 1.2.3.4
The development and staging environments will be on their own VPS instance. I've configured the appropriate DNS records so each environment has its own sub-domain (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 confix (Rails, Passenger) sets the root for each server (wild card SSL is configure in the http definition and port 80 redirects 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
}
I'm a bit confused on the Rails side what else do I need to do to configure the environments so I can access the individual dev and staging environments by URL:
staging.myapp.com
dev.myapp.com
I know Capistrano allows you to set production and staging environments but I need both the dev and staging URLs to be live or should this be sufficient?