Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
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
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 goes to 8000, 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


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.