I'm aware that nodejs can run on the port 80 by :
- setting up a proxy with apache/nginx
- setting up a port redirection with an iptables rule
- making express listen on port 80 within the app
The first option isn't the easiest and require more dependencies then I need. The second one could be working but on my OpenVZ VPS it won't (and I can't compile a custom linux kernel).
I needed to handle some sub-domains too, and after reading this stackoverflow answer, I tried the third solution. It's perfectly working and very easy to perform.
I was wondering if there might be some security issues while running nodejs directly on the 80 port ? How may I fix/found these ?
I wanted to use pm2 to handle the processes and it might run not as root (Goodbye node-forever hello pm2).