Categories
JavaScript Answers

How to run Node.js on port 80?

Spread the love

To run Node.js on port 80, we route port 80 to the local port the Node app is running on.

For instance, we run

sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

to run iptables to add a route entry to route port 80 to our Node app running on port 8080.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *