Skip to content

Instantly share code, notes, and snippets.

@chege-kimaru
Created July 4, 2020 12:09
Show Gist options
  • Save chege-kimaru/2af8b17c3c7143f3578bcf1bac173d19 to your computer and use it in GitHub Desktop.
Save chege-kimaru/2af8b17c3c7143f3578bcf1bac173d19 to your computer and use it in GitHub Desktop.
Reverse Proxy in apache
#If ot backfires, do this first
#a2enmod proxy
#a2enmod proxy_http
#/etc/apache2/sites-available/abcd.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName mySite
ServerAlias www.abcd.com
DocumentRoot /var/www/html/abcd
<Directory />
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
<Proxy *>
Require all granted
</Proxy>
<Location /nodejsApp>
ProxyPass http://127.0.0.1:8080
ProxyPassReverse http://127.0.0.1:8080
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment