Tsea Tsea - 11 months ago 35
Node.js Question

How do I get nodejs to run without a port number on an Apache server

I have a nodejs api app running inside a codeigniter environment. I would like to be able to use my node js api's with out using a port number in the url

currently you can only hit the node api at


And I would like to have it accessible through a url like :


I tried to run a reverse proxy with no success

<VirtualHost *:80>
ServerName ec2-14-210-250-136.us-west-2.compute.amazonaws.com

ProxyRequests off

<Proxy *>
Order allow,deny
Allow from all

ProxyPass / http://localhost:8010/
ProxyPassReverse / http://localhost:8010/
ProxyPreserveHost on

This let me access the node api with the url I want but I can no longer access the home page of my codeigniter environment


Assuming you intend to differentiate requests looking for the nodejs app from requests seeking the codigniter app by seeing /api as the root path, try:

ProxyPass /api http://localhost:8010/api
ProxyPassReverse /api http://localhost:8010/api

See ProxyPass and ProxyPassReverse for more magic.