Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Route 53 Record Set on Different Port

Tags:

I'm a ruby dev and I just started to learn some Node.js.

I'm running an instance on AWS to host my rails apps with passenger + nginx listening on port 80.

Now I would like to host a node.js app on the same instance (t1-micro) and put it to listen on port 8000.

How can I use Route 53 to create a Record Set to point a subdomain.domain.com to my.ip:8000?

I already tried setting an IPV4 record pointing to my.ip:8000 with no success.

Any idea what I'm doing wrong?

Can I use nginx to serve my nodejs apps?

like image 692
gverri Avatar asked Oct 13 '13 19:10

gverri


People also ask

What record set is Route 53?

Route 53 provides an extension to DNS functionality known as alias records. Similar to CNAME records, alias records let you route traffic to selected AWS resources, such as CloudFront distributions and Amazon S3 buckets.

What is the difference between CNAME and A record in Route 53?

To clarify my question, the difference between CNAME and A record in a traditional NameServer is that only CNAME can be used to point to a different subdomain and A record must point to a valid IP address. Since the AWS Route53 allows you to do use a subdomain with either A Rec or CNAME ..

Is Route 53 multi region?

With Amazon Route 53s new Latency Based Routing (LBR) feature, you can now have instances in several AWS regions and have requests from your end-users automatically routed to the region with the lowest latency.

What is a CNAME in Route 53?

CNAME records Route 53 responds to the first DNS query with the name of the record that you want to redirect to. Then the DNS resolver must submit another query for the record in the first response to get information about where to direct traffic, for example, the IP address of a web server.


1 Answers

This is possible through S3 redirection. Create a S3 bucket with the name

subdomain.domain.com 

This bucket does not need to be public. Then, turn on Static Website Hosting in Properties and choose the Redirect response option and configure it with the following options

Target bucket or domain: my.ip:8000 Protocol: Leave this blank 

Then go to Route53 and create a Record Set with the following configuration

  • Name: subdomain.domain.com
  • Type: A-IPv4 address
  • Alias: Yes
  • Alias Target: Choose the bucket you just created in S3. If it does not appear wait for it to appear.
  • Routing Policy: Simple
  • Evaluate Target Health: No

And that's it, you should be able to go to subdomain.domain.com and see the changes take effect after roughly 30 seconds. Best of luck!

like image 193
stelo Avatar answered Oct 10 '22 05:10

stelo