Log in

No account? Create an account

Node js on port 80 - Look, someone's on that tree

Mar. 13th, 2011

10:38 am - Node js on port 80

Previous Entry Share Next Entry

Yes, I know, nodejs on port 80 is not a good idea, however if the project completely disregards the proven http servers and completely relies on node for all http traffic we need to make compromises. Or not.

Here is how I run node as main http server:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
And of course we close all other ports, as usual for web servers facing the world.

Disclaimer: I found this on Internet, the original 'thanks' go to: @rckenned, @jrconlin, and @spullara ... see also http://iptables.rlworkman.net/chunkyhtml for a pretty definitive-looking iptables tutorial from @frozentux

Current Location: Bulgaria, Varna
Current Music: Mylene Farmer - California