Last active
February 25, 2020 00:46
-
-
Save iMagdy/6117502 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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
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> |
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.
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
What is this part for ?