i'm creating app in addition live production environment requires development , staging environment. production environment live , on own vps instance. record:
myapp.com 1.2.3.4
the development , staging environments on own vps instance. i've configured appropriate dns records each environment has own sub-domain (a record in myapp.com domain pointing dev/staging server:
dev.myapp.com 5.6.7.8 staging.myapp.com 5.6.7.8
the nginx confix (rails, passenger) sets root each server (wild card ssl configure in http definition , port 80 redirects 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 bit confused on rails side else need configure environments can access individual dev , staging environments url:
staging.myapp.com dev.myapp.com
i know capistrano allows set production , staging environments need both dev , staging urls live or should sufficient?
you can set environment each instance using rails_env
option. example:
server { listen 443; server_name staging.myapp.com; root /apps/myapp/staging/public; passenger_enabled on; rails_env staging; }
Comments
Post a Comment