Not sure how it’s done or where to look. When I start Keystonejs it starts at port 3000 and i want to be 80…
Is there a way to do that?
Thanks, Brian R.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
KeystoneJS apps will default to using port 3000, but they will respect the PORT
environmental variable. So in order to run it on port 80, you could start it like:
PORT=80 node keystone
See the web server options in the KeystoneJS configuration docs.
In a more robust production setup, you might want to use an Nginx reverse proxy instead of serving it on port 80 directly. Check out this tutorial for more information:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 3000 -j REDIRECT --to-port 80