- Mod_Proxy module comes in-built with other Apache modules.Add/uncomment the below lines in $APACHE_HOME/conf/httpd.conf
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so - Add below lines to the end of $APACHE_HOME/conf/httpd.confProxypass /server1/ http://localhost:8080/
ProxypassReverse /server1/ http://localhost:8080/Proxypass /server2/ http://localhost:8280/
ProxypassReverse /server2/ http://localhost:8280/ - Setting up Virtual Host
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName ci.company.com ServerAlias ci ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost on ProxyPass / http://localhost:8080/ nocanon AllowEncodedSlashes NoDecode </VirtualHost>
- Restart Apache service.
Starting:service http stop
Stopping:
service http start
References
- https://httpd.apache.org/docs/2.4/vhosts/examples.html
- https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
- https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
- http://httpd.apache.org/docs/2.4/howto/reverse_proxy.html