title: Apache Access Control to IPs (X-Forwarded-For) or valid-user
body: <p>I used to block access to certain folder of my Apache server using valid-user or ip directive, like the following:</p>
  
  <pre><code>&lt;Directory "/home/domain/public_html/secure"&gt;
      Require ip x.x.x.x
      Require ip y.y.y.y
      AuthType Basic
      AuthUserFile "/home/domain/secure/pass"
      AuthName "Authentication Required"
      Require valid-user
      Satisfy Any
  &lt;/Directory&gt;
  </code></pre>
  
  <p>Now, I have placed my server behind an F5-BIGIP device which won't let me fully DNAT client's connections. The device is also behind a Linux server that serves as gateway with DNAT/SNAT rules hat are working accordingly. I can log client's IPs through X-Forwarded_For, though. But my Apache directives are not working anymore.</p>
  
  <p>So my question is, is there any way I could use something like <code>Require X-Forwarded-For x.x.x.x</code>?</p>
  
  <p>My Apache Version is:</p>
  
  <pre><code>[root@webserver1 ~]# apachectl -version
  Server version: Apache/2.4.6 (CentOS)
  Server built:   May 12 2016 1
  </code></pre>
  
  <p>0:27:23</p>
  
  <p>Thanks in advance.</p>