I have an api running in a EC2 instance in AWS in certain port (ej 8000). I have register a domain in bluehost provider.
Currently my app is pointing to the IP that offer the EC2 instance, but I want to change to the domain in order to use like api.mydomain.com:8000.
I tried to create a configuration in the DNS zone of panel control in the bluehost account, but it does not work, I think the DNS type I have to use is the ‘SRV record’, but I tried some configuration but the cpanel dont take it.
How I can make that the request to ‘api.mydomain.com:8000’ redirect to the EC2 instance’s IP and the configurated port?. Thank you
2
Answers
Normally you would create an ‘A’record to point a domain name to a IP address, not a ‘SRV’ record.
You can use a normal A record for api.mydomain.com and point that to your instances IP address. You don’t include the port anywhere in the DNS configuration.
If it was a website that was on port 8000 you would type api.mydomain.com:8000 in your browser url.
Make sure that your instances security group is open on port 8000, and that your instance is listening on port 8000.
When you say “it didn’t work”, what do you mean? Where was there a failure?