Configure Reverse Proxy for Apache Server

Shameer Ahmed
Geek Culture
Published in
2 min readMar 14, 2022
reverse proxy call process

Proxy servers have become a need in today's era in managing complex networks, performance, and security concerns. Proxy servers are divided into two types front proxy servers and reverse proxy servers. Both have different applications and use cases. Today, we will talk about how to configure reverse proxy on apache for different cases whether your server is secure such as HTTPS or working on HTTP. How do you send to request to reverse proxy request to HTTPS secure server n both cases? We will be going through both configurations in this article.

To setup reverse proxy for any backend URL which is currently not secure but the server we are are requesting data is on secure the below configuration is required which should add in either http.d file in case of XAMP or the main config file in case Linux based configuration:

ProxyRequests Off
ProxyPreserveHost On
ServerName localhost
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
# Servers to proxy the connection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
# Example:
ProxyPass /ws/ https://{{url}}/api/1.0/webhooks/
ProxyPassReverse /ws/ https://{{url}}/api/1.0/webhooks/

(This config is needed when the instance in on HTTP and the URL which is being reverse proxied in HTTPS this setting is needed)

Now if your server is also running on SSL the required parameters for config are reduced parameters are required, following configuration can be used:

ProxyPreserveHost On
# Servers to proxy the connection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
# Example:
ProxyPass /ws/ https://{{url}}/api/1.0/webhooks/
ProxyPassReverse /ws/ https://{{url}}/api/1.0/webhooks/

These configurations can be directly used on windows XAMP, but if you using apache on a Linux based environment you may need to install these more specific modules which you can check out on this link

--

--

Shameer Ahmed
Geek Culture

a Tech savvy with a curious mind, having curiosity in entrepreneurship, business, and personal development. https://shameerahmad.me/