Skip to content

Instantly share code, notes, and snippets.

@tigefa4u
Forked from iMagdy/node_apache.apacheconf
Created February 22, 2016 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tigefa4u/1b09fdd36de7104b70b7 to your computer and use it in GitHub Desktop.
Save tigefa4u/1b09fdd36de7104b70b7 to your computer and use it in GitHub Desktop.
This virtualhosts snippet will make your nodejs app run on the traditional port 80, so mynodeapp.com:3000 will simply work on mynodeapp.com without adding :3000. it's that simple :) remember to enable apache modules proxy and proxy_http ($ sudo a2enmod proxy && sudo a2enmod proxy_http)
<VirtualHost *:80>
ServerAdmin isl@m.magdy
ServerName js.io
ServerAlias js.io
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://127.0.0.1:3000/
ProxyPassReverse http://127.0.0.1:3000/
</Location>
DocumentRoot /var/www/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment