When we create APIs using nodejs we often enable them to run on particular port number. It is all fine until we move into production environment where we don’t want our port number to visible to our clients while we are making the server request calls using the APIs.
So a solution would be to mask our port number and let apache handle the request and redirect the request to that server internally without revealing the port number. For this we need to edit the apache configuration like following.
Open the file /etc/apache2/sites-enabled/000-default.conf using any editor and add the following lines under or above the directory tag.
Allow from all
Then save the file and restart apache and try to run the API request without the port number.