Here's my situation:
I have a server running Apache on port 80
, a node.js application on port 8000
, and I'd like to know if I have to open ports in order for ProxyPass
and mod_proxy
to work.
Port 80 has to be open as Apache will serve external requests on it.
If your Node.js application is running on the same host as Apache you don't need to open port 8000.
But if your Node.js application is running on different host than Apache, then you'll need to open port 8000 only for the IP of the server where Apache is running.
If you use something like this:
ProxyPass http://localhost:8000
and default input policy is DROP:
iptables -P INPUT DROP
so, you still need to open port 8000 on the loopback interface:
iptables -A INPUT -i lo -p tcp --dport 8000 -j ACCEPT