How to use React JS and Node JS App without Port

Use Apache as a proxy server using ProxyPass and ProxyPassReverse to access internal IPs from an external machine

As we know every node js application is running on particular port. and we think about to host on production server, we have to run on port there. As simplicity we don’t want to disturb the internal of Node JS.

Let’s take an example here. If you Node JS application is running on port 3001 and your base URL is something like http://MY_IP_ADDRESS:3001 but you want something like http://MY_IP_ADDRESS/api. So this can be hack by playing with apache default configurations.

Steps to follow

Use Apache as a proxy server to access internal IPs from an external machine

Install apache2. On Ubuntu

sudo apt-get install apache2

Enable the various modules needed. You can do that with the a2enmod tool: