I'm using sub-domains within my Padrino configuration. I've created multiple A records in AWS Route 53 to route to things like api.myapp.com & admin.myapp.com, myapp.com, www.myapp.com. This is working as expected. Here's what my configuration looks like:
Padrino.mount('MyApp::App', :app_file => Padrino.root('app/app.rb')).host('api.myapp.com')
Padrino.mount('MyApp::Manager', :app_file => Padrino.root('manager/app.rb')).host('manager.myapp.com')
Padrino.mount("MyApp::Admin", :app_file => File.expand_path('../../admin/app.rb', __FILE__)).host("admin.myapp.com")
Padrino.mount('MyApp::Web', :app_file => Padrino.root('web/app.rb')).to('/')
I've replaced the real name to "myapp" for the purpose of this question. The problem is when I attempt to access these sub-domains on my localhost. It keeps routing to web/app.rb (which is at just '/'). I tried altering my /etc/hosts
as so:
127.0.0.1 localhost
127.0.0.1 manager.myapp.com
127.0.0.1 api.myapp.com
127.0.0.1 admin.myapp.com
Then when I try to hit manager.myapp.com:3000
, it routes to what's being served as the root domain (MyApp::Web). Why is this happening?