Node.js Server with Apache

Posted February 12, 2018 4.6k views
MySQLApachePHPNode.jsUbuntu 16.04

Hi everyone,

I’m currently using Docker, and i have installed portainer and done tests using httpd etc.

Basically i have a Node.JS server that i want to be running at that is restricted to requests from and ( should i do something except using CORS ? ).

I want to use the and websites at port 80.

Meanwhile this i need to restrict access to phpmyadmin and portainer to only be available in localhost too …

Since i’m a noob at server managament and this is a new world for me yet .. i wonder if something can guide me to what i need to do.

For the restrictions i think i need to use ufw / iptables. but i don’t know how i can make this things work together.

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.

Submit an Answer
1 answer


What I could suggest is using Apache as a reverse proxy for your Node.js applications. You could create 2 different Apache Vhosts for your main site and your dev site.

To set up Apache as a reverse proxy you can follow the steps here:


by Mateusz Papiernik
In this tutorial, you will set up Apache as a reverse proxy using the `mod_proxy` extension to redirect incoming connections to underlying application server(s) running on the same network. There are instructions on setting up a simple web app using the Flask framework to show how Apache interacts with the real application hidden behind it, but you can also follow this tutorial using your existing application server, if you have one.