apache
creating a virtualhost with reverse proxy
add library and enable modules
bash
sudo apt-get install libapache2-mod-proxy-html
sudo a2enmod proxy proxy_http proxy_connect proxy_html xml2encrestart
bash
sudo service apache2 restartadd a new virtualhost file
apache
<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
bash
sudo a2ensite site-proxyrestart apache (again)
bash
sudo service apache2 restart