I have an Elastic Beanstalk application that I'm attempting to route a custom domain name to using a Route 53 hosted zone, i.e., mycustomdomain.com should route to fooelbapp.us-east-2.elasticbeanstalk.com. Within the Route 53 hosted zone, I've created an A Record with mycustomdomain.com as the name and a value of ALIAS fooelbapp.us-east-2.elasticbeanstalk.com. Now when I attempt to navigate to mycustomdomain.com, I receive a redirect to fooelbapp.us-east-2.elasticbeanstalk.com, which is not the expected behavior. The expected behavior is a 200 response and the page to load under the custom domain name, not the Elastic Beanstalk CNAME URL. Has anyone else experienced this issue?
The Elastic Beanstalk application is a WordPress 4.8.2 site on PHP 7.
Solution
#Mark B is correct, the issue was caused by my Site Address and WordPress Address being set to the Elastic Beanstalk CNAME URL, after correcting this everything works as expected and my custom domain name now resolves to the Elastic Beanstalk application without 301 redirecting.
Route53 does not issue HTTP redirects. What is happening is your application server thinks it is serving the domain fooelbapp.us-east-2.elasticbeanstalk.com, probably because that's the domain it finds when it starts up. So any requests it receives that aren't for that domain it is redirecting.
You need to configure your application to be aware of the actual domain name you want it to serve. How you would do that will depend on what web server you are using. If you need more help please provide more details about your environment.
Related
I am attempting to use a domain registered with Amazon Route 53 to access an Elastic Beanstalk (nodejs) site. I originally had it working ok, but something broke and I can't for the life of me get it to work again.
In summary, I have:
An Elastic Beanstalk environment that is accessible via its url (i.e. ***.ap-southeast-2.elasticbeanstalk.com)
A domain registered through Amazon Route 53
A hosted zone in Route 53, with a document added with Type=A and routing traffic to the Alias (to my Elastic beanstalk environment)
I have edited the named servers in the registered domain to match that of the hosted zone
When I do a "Test Record" from the Hosted Zone, it returns "DNS response code No Error", and returns the IP address of my Elastic Beanstalk application. But, when i go to the URL I get "The Requested Host you requested is not resolvable."
As mentioned, I originally had it working. I then attempted to set up a redirect from http to https via Cloud Front, and managed to break it. I have subsequently removed all https & cloud front config in attempt to get the basic URL access working again. I suspect my issue is that I deleted my default Hosted Zone created by Amazon when I registered the domain, and I have a setting wrong.
Any ideas?
I never got to the bottom of this. Instead created a new elastic beanstalk environment, then reconfigured the domain and certificate to the new instance.
I have no idea what the difference is as all settings appear to be the same. But it at least gave me a way forward.
I registered an .link domain name with Route53 and experimented a little bit with it.
First I created an record to route traffic to my S3 static webpage. After that I deployed an Elastic Beanstalk app and tried to route the traffic to the Elastic IP of my EB instance.
I am getting the whole time "no response" messages. When I do a test on the record set, I am getting the right IP in the "Response returned by Route 53" field.
I even done an whois request on my domain name, and nowhere were mentioned the information I entered during the registration.
Did I forget something or do I have to pay attention on something?
I noticed that the Domain name status code is blank for this domain name.
Like you, I'm using Route53 to route traffic to an Elastic Beanstalk instance.
In EB, under "All Applications", I have a running application with a URL ending in ".elasticbeanstalk.com"
Then, in Route 53, I have a record which routes a particular subdomain to my EB URL:
The blank Domain name status has nothing to do with the problem. The domain name works now and the Domain name status is still blank.
The problem was that the nameservers for the registered domain not matched the nameservers of the hosted zone. The support provided me the correct namerservers, I replaced the nameservers of the registered domain and the hosted zone with the one the support provided me and everything works fine.
Kind regards
I have been trying to connect my domain with my elastic beanstalk instance.
My domain was purchased off GoDaddy and I have updated the nameservers to point to AWS and verified through dig. If dig comes up with the NS, it means GoDaddy is properly configured to point to the DNS right?
The Test Record Set function also does not show any error and has a proper response returned which has NOERROR
Problem is I still receive an ERR_NAME_NOT_RESOLVED everytime I try to load the website on browsers even tried on different devices
I have also checked the alias used in my Hosted Zone and its up and running
What I have already done:
Initialized and created Beanstalk environment - Up and Running
Public Hosted Zone - Created A record for www.mysite.com
GoDaddy DNS NS - updated with AWS 4 nameservers
Checks I have done:
Internal Test Record for A www.mysite.com
Dig Command
What could I be missing?
UPDATE***
So I figured "www.mysite.com' was working but 'mysite.com' alone was not. I'm assuming route53 will automatically use the www A record? But seems like its not?
Hope ya'll could help
Thanks!
Got it to work.
Looks like besides creating a www A record, I had to create a record for the root domain i.e mysite.com in the Record Set of my Hosted Zone
Solved!
Using Amazon's Guide, I created an Elastic Beanstalk application for a Wordpress/Woocommerce app. The EB domain contains a region, i.e., my-app.us-east-N.elasticbeanstalk.com. I followed the guide for using my own host (mysite.com), which I have set up on Route 53.
Whenever I hit mysite.com, I get a 301 redirect to my-app.us-east-N.elasticbeanstalk.com. I simply am using the A Alias record for mysite.com to point to that EB domain, exactly as in their guide. How do I stop it from redirecting? I dont want to use the EB domain, I want to use mysite.com to load the content coming from the EB domain. I havent yet found any AWS docs that explain this, the directions for doing what I want are incredibly simple (but dont seem to work).
There is nothing in default AWS Elastic Beanstalk setup that would cause such redirect. You should check if it is your app that is sending the redirect (especially since the Wordpress is known to force the redirect to its default/configured site URL).
All,
I'm sure there's a very simple solution that I'm missing but I've given up looking!
I'm using Route 53 on AWS with elastic beanstalk. At the moment I've got a CNAME to route to my elastic beanstalk instance which is working fine, but I'm trying to get another one with a different subdomain linking to another path but don't seem to be having any success.
For example:
CNAME 1: www.example.com Routing to mysite.eu-west-1.elasticbeanstalk.com
CNAME 2: news.example.com Routing to mysite.eu-west-1.elasticbeanstalk.com/news
I've tried testing the second one, and noted that the response returned as \057 in place of the forward slash, not sure if that's part of the reason.
Route53 is a DNS service. DNS is only used for the domain name portion of the request. Route53 can not route to a specific path. You would need to configure your Apache or Nginx server on your Elastic Beanstalk instance to route requests for the 2nd domain name to that specific path.