Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Which is the best method (in terms of speed / best practices) for hosting a Node/Express app on an EC2 server instance running Ubuntu?

  1. Use Nginx as a proxy as outlined in this question.
  2. Add a port forwarding rule in iptables, e.g https://gist.github.com/776580.

Can anyone outline any problems with either method, it just seems a bit pointless using Nginx when all I'm doing is forwarding requests from port 80 to 8000.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The advantage of using nginx is that it is easier to manage multiple domains as well as caching of static files.

share|improve this answer
1  
I agree. Right now, it's "just" forwarding from 80 to 8000. But what are you going to do if/when you have another webapp on 8001? You can't forward a port to both at the same time. However, if you're using Nginx then it's just another virtual host setup and anything for test.example.com goes to 8000, live.example.com to 8001, in very little time. –  gac May 28 '12 at 14:33
    
Good points, I'm now using Nginx as a proxy. Port forwarding using iptables would work for one app but as you say it's much more manageable using Nginx were I to host multiple apps. –  StuR May 29 '12 at 9:21

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.