Apache
Creating a virtualhost with reverse proxy
Add library and enable modules
sudo apt-get install libapache2-mod-proxy-html
sudo a2enmod proxy proxy_http proxy_connect proxy_html xml2encRestart
sudo service apache2 restartAdd a new virtualhost file, like /etc/apache2/sites-available/site-proxy.conf
<VirtualHost *:80>
ServerAdmin hostmaster@example.com
ProxyRequests off
DocumentRoot /var/www
ProxyPreserveHost On
# Set the URL used on live env
ServerName example.com
# If more than one URL will be used,
# add here one per line
ServerAlias www.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# Possible values: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel error
<Location />
# Site URL to be accessed
ProxyPass http://internal.example.com:8444/
ProxyPassReverse http://internal.example.com:8444/
Order allow,deny
Allow from all
</Location>
</VirtualHost>Add this virtualhost to Apache
sudo a2ensite site-proxyRestart Apache (again)
sudo service apache2 restart
Rodrigo de Avila