Currently I already created elasticbeanstalk with docker platform and running well.
My problem here : I want to route my subdomain via route 53 redirect to my elastic beanstalk. I already go to route 53 and change my subdomain CNAME pointing to my elastic beanstalk. I check with dig command :
;; global options: cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8115
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;staging.ecodi.cloud. IN A
;; ANSWER SECTION:
staging.mydomain.com 145 IN CNAME myelasticbeanstalk.ap-southeast-1.elasticbeanstalk.com.
myelasticbeanstalk.ap-southeast-1.elasticbeanstalk.com. 36 IN A 175.xx.xx.xx
myelasticbeanstalk.ap-southeast-1.elasticbeanstalk.com. 36 IN A 52.xx.xx.xx
;; Query time: 38 msec
;; SERVER: xx.xx.xx.xx
;; WHEN: Sat Mar 19 10:36:34
;; MSG SIZE rcvd: 140
but when I access staging.mydomain.com via browser its not work.
the weird here is, I can access directly via browser with URL myelasticbeanstalk.ap-southeast-1.elasticbeanstalk.com
So I need help how to resolve this? I need access myelasticbeanstalk via my subdomain only.
Thanks All
CodePudding user response:
Since your URL includes the region name ap-southeast-1
, you need to use Route 53 Aliases.
If the domain name includes the Region You can create an alias record. An alias record is specific to Route 53 and has two significant advantages over CNAME records:
You can create alias records for the root domain name or for subdomains. For example, if your domain name is example.com, you can create a record that routes requests for example.com or for acme.example.com to your Elastic Beanstalk environment.
Route 53 doesn't charge for requests that use an alias record to route traffic.
To create an Alias for Elastic beanstalk see the instructions here