title: Unable to restrict access to Apache 2.4 Reverse Proxy on SSL by IP
body: <p>I'm trying to restrict access to a reverse proxy on my Apache 2.4 server. It works on http but not on https.</p>
  
  <p>I set up a ProxyPass and ProxyPassReverse on / to another server, and have 2 .conf files which contain the same Require ip line. The http reverse proxy works, but the https one says "client denied by server configuration.</p>
  
  <p>Server is 10.0.1.1, the endpoint is 10.0.1.2.</p>
  
  <p>http_vhost.conf</p>
  
  <pre><code>&lt;Location /&gt;
     Require ip 10.0.0.0/16
  &lt;/Location&gt;
  ProxyPass / http://10.0.1.2/
  ProxyPassReverse / http://10.0.1.2/
  </code></pre>
  
  <p>https_vhost.conf</p>
  
  <pre><code>&lt;Location /&gt;
     Require ip 10.0.0.0/16
  &lt;/Location&gt;
  SSLProxyEngine on
  ProxyPass / http://10.0.1.2/
  ProxyPassReverse / http://10.0.1.2/
  </code></pre>
  
  <p>Accessing the http_vhost from a 10.0.1.100 ip address, vhost works as intended. Site content on 10.0.1.2 shows as intended.</p>
  
  <p>Accessing the https_vhost from the same 10.0.1.100 ip address, vhost content shows</p>
  
  <pre><code>Forbidden. You don't have permission to access / on this server.
  </code></pre>
  
  <p>https_vhost shows the following in the access.log:</p>
  
  <pre><code>127.0.0.1 - - [14/Aug/2019:12:47:21 +0800] "GET / HTTP/1.1" 403 6692 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15"
  </code></pre>
  
  <p>But shows the following in the error.log:</p>
  
  <pre><code>[Wed Aug 14 12:48:04.604656 2019] [authz_core:error] [pid 4671] [client 127.0.0.1:54607] AH01630: client denied by server configuration: http://10.0.1.2/
  </code></pre>
  
  <p>The access.log entry for the http server is:</p>
  
  <pre><code>mydomain.com:80 10.0.1.100 - - [14/Aug/2019:18:13:35 +0800] "GET / HTTP/1.1" 200 348 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15"
  </code></pre>
  
  <p>When I comment the "Require ip" line, both http and https work as intended.</p>
  
  <p>Anybody knows how to solve this?</p>