Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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>
@coalwater

This comment has been minimized.

Copy link

@coalwater coalwater commented Jul 30, 2013

What is this part for ?

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>
@coalwater

This comment has been minimized.

Copy link

@coalwater coalwater commented Jul 30, 2013

Rename the gist to "node_apache.apacheconf" to get syntax highlighting, and change the indentation to 4 instead of 5, more standard, example here, too bad pull requests are not available in gists.

@iMagdy

This comment has been minimized.

Copy link
Owner Author

@iMagdy iMagdy commented Sep 9, 2013

All done :) Thanks for the feedback.. Sorry for being too late to reply on this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment