Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I´m trying to config a website hosted in AWS EC2 instance. But Im a bit mixed!!

I have an AngularJS application running in a Node.js server listening on port 1234. This site is deployed correctly, so when I get the url in a browser ec2-instance-public-dns:1234/app/index.html I see my site perfectly.

In the other hand, I registered a domain name in GoDaddy. I set up a Route 53 and the DNS names in GoDaddy.

I see, I also have a load balancer listening in port 80, that is redirecting to port 1234.

What I need is to link my domain with my site in the path ec2-instance-public-dns:1234/app/index.html

All this stuff is not working. How can I achieve this?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted
  • Is there is reason why you don't have Node listen to 80 or 8080 ?
  • Does the DNS redirection work ? -> Can you access your site with www.yourdomainname.com:1234 ? -> If no, then check your dns config, you should not have to deal with port routing at that level.
  • Are you using Linux as your EC2 instance ? If yes, reroute port 80 toward port 1234 as explained here (http://www.cyberciti.biz/faq/linux-port-redirection-with-iptables/).

That how I do it, hope that helps.

share|improve this answer
    
I really appreciate all your comments. I will check everyone of them. Once I have all this working, if I understand right if I get www.domain.com I would get ec2-instance-public-dns:1234 or ec2-instance-public-dns:80 (depending on the port configured), but my welcome page is in browser ec2-instance-public-dns:1234/app/index.html (I mean, the point is app/index.html path), I need to get this view when I request www.domain.com –  Rober yesterday
    
You will achieve this using for example a nodejs module such as Express that allows to define routes (in your case '/' should render app/index.html) –  webaba yesterday
    
Correct, This is what I need. Unfortunately, I have no idea about Express, I will have to have a look at it. The only problem I wouldn´t like to make my life hard with this. Do you think it worth to invest in this or should I replace this node.js with a NGINX server (in example). –  Rober yesterday
    
This is my current node.js server script plnkr.co/edit/2VESE6q26I0AyF2r81y4 . Could you help me to update it for this routing? –  Rober yesterday
    
I would not be clearer that this awesome tutorial that I recommand you scotch.io/tutorials/javascript/… –  webaba yesterday
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.