Follow the steps below to allow the forwarding of network communication in Apache HTTP Proxy:
- Open the Apache HTTP Proxy configuration file for editing. The file name and its location can vary depending on the operating system:
- Windows:
C:\Program Files\Apache HTTP Proxy\conf\httpd.conf
- Linux - Debian distributions:
/etc/apache2/mods-enabled/proxy.conf
- Linux - Red Hat distributions:
/etc/httpd/conf/httpd.conf
- Add one or more <ProxyMatch> Directives. Use the following syntax:
<ProxyMatch regex>
Allow from all
</ProxyMatch>
In each <ProxyMatch> segment, you can specify (as a regular expression) the address (IP or domain) to which you want to allow forwarding of the network communication.
See examples below on how to use regular expressions.
- Save the configuration file and restart the Apache HTTP Proxy service.
- Verify if the new connection forwarding settings are working.
Examples - regular expressions:
- Allow an IP address (in this example https://10.20.30.40):
<ProxyMatch ^([h,H][t,T][t,T][p,P][s,S]?://)?([^@/]*@)?(10.20.30.40)>
Allow from all
</ProxyMatch>
- Allow the specified web domain (in this example https://eset.com and any of its subdomains https://*.eset.com):
<ProxyMatch ^([h,H][t,T][t,T][p,P][s,S]?://)?([^@/]*@)?([a-zA-Z0-9-]{0,63}\.)?[a-zA-Z0-9-]{0,63}\.[e,E][s,S][e,E][t,T]\.[c,C][o,O][m,M](:[0-9]+)?(/.*)?$>
Allow from all
</ProxyMatch>
- Allow all IP addresses in a specified subnetwork (in this example
https://10.20.30.*
andhttps://40.50.60.*
).
<ProxyMatch ^([h,H][t,T][t,T][p,P][s,S]?://)?([^@/]*@)?(10.20.30.|40.50.60.)([0-9]+)(:[0-9]+)?(/.*)?$>
Allow from all
</ProxyMatch>