Home > Back-end >  point only a subdomian to AWS EC2
point only a subdomian to AWS EC2

Time:07-27

I own the example.com domain name. For the moment I connect that to two services.

One for firebase as a A name record for the sudomian business.example.com Another for AWS as A record and a CNAME record.

This is my namecheap Advanced DNS settings

Type Host Value
A record @ AWS IP
CNAME record api example.com
A record business Firebase IP

For the moment if I visit http://example.com/ it will show me the "Welcome to nginx", So that is clear that since the host is point to @ in the A record, the domian is fully connected to the AWS eC-2 What I want is to ONLY CONNECT api.example.com to AWS and connect full domain to vercel. So that I can use example.com and www.example.com in vercel.

How do I do this?

CodePudding user response:

First, make sure that you have created an Elastic IP address in the Amazon EC2 management console. This is a static IP address that will stay with the instance (and can be moved to other instances).

Then, configure your DNS with an A-record that points api to the Elastic IP address:

Type Host Value
A record @ Vercel IP address
A record api Elastic IP address (eg 1.2.3.4)
A record business Firebase IP
  • Related