[KB6907] Apache HTTP Proxy connection failed (6.x)

Follow the steps below to allow the forwarding of network communication in Apache HTTP Proxy:

  1. 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
  1. 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.

Validate regular expressions

To make sure the regular expression is correct, you can validate it online - for example here:

  1. Select python in the flavor menu on the left.
  2. Paste your regex in the Regular Expression field.
  3. Type a string (address) you want to match with the regex into the Test String field.
  4. See Match Information on the right to verify if the regex matches the provided test string.
  1. Save the configuration file and restart the Apache HTTP Proxy service.
     
  2. Verify if the new connection forwarding settings are working.

 

Examples - regular expressions:

  1. 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>

  1. 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>

  1. Allow all IP addresses in a specified subnetwork (in this example https://10.20.30.* and https://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>