A Domain Name System (DNS) problem: (also asked on stack-overflow)
I've got an Amazon Web Services (AWS) Elastic Beanstalk (EB) site with potentially thousands of subdomains.
Apparently it's not possible to use A-records with AWS, as they do server balancing and have shifting IP addresses.
So far I've setup a CNAME record:
www CNAME http://mysite.elastic-beanstalk.com.
and a web forward, to handle requests to the 'naked' domain.
@ / http://mysite.elastic-beanstalk.com
I now need to map the subdomain urls to the correct place:
url typed and seen by the user >> currently live and working page
subdomain1245.mysite.com >> http://subdomain1245.mysite.elastic-beanstalk.com,
www.subdomain1245.mysite.com >> http://subdomain1245.mysite.elastic-beanstalk.com
The closest tutorials I could find mentioned 'wildcard' DNS matching, like:
* CNAME http://mysite.elastic-beanstalk.com.
I tried the latter, and from what I could tell from testing, it simply redirected all subdomains to the main domain.
I need the subdomains to both stay shown in the url, and redirect to the subdomain page.
If anyone could show - and ideally explain - a strategy it would be tremendously helpful!
* CNAME http://mysite.elastic-beanstalk.com., visiting
subdomain1245.subdomain1245.mysite.com serves up the correct page (subdomain1245.mysite.elastic-beanstalk.com).
We have found another possible option:
* CNAME http://mysite.elastic-beanstalk.com. DNS record, and instead using a
* / http://mysite.elastic-beanstalk.com
Though this too seems to need some server configuration...(???)
The app is rails, and the AWS EB instance type is ruby 2.0 passenger-standalone.
It seems that convention for modifying EB servers is via
.config files in a
/var/app/current/.ebextensions/ folder (this is in the rails project root, and is added to the project git repo).
No idea how to handle the subdomain with (phusion) passenger, or how to configure that via a
Are we on the right track, even? Hmmm