I've started to get into AWS today and created a simple EC2 Instance with a Node.js app listening on port 3001
.
I can access it through my public DNS at ec2-12-34-123-123.eu-central.amazonaws.com:3001
and get a Hello World
output.
Not I'm trying to set up a custom domain to this instance.
I've done the following steps:
- Created a domain with Route 53
- Created an Elastic IP and assigned it to my EC2 Instance
- Created a Hosted Zone and an
A
record for the Elastic IP
But still I can't access my server via mydomain.com:3001
Did I do anything wrong?
And how can I setup multiple subdomains forwarding to a specific port? For example:
api.mydomain.com
mydomain.com
jenkins.mydomain.com
and so on, when everything is listening on another port?
Creating a record for my IP:port
I get wrong value
, because the ip:port
syntax is not valid.
Edit:
Just did everything again.
- created EC2 instance, launched node app on port 80
- created elastic ip
- created hosted zone for domain
- registered ns on registrar for my domain
- created A record for www.mydomain.xyz + alias mydomain.xyz
When I try to go to www.mydomain.xyz I only get the Gandi page with my data.
Does anyone know what I did wrong?