Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264
Source Link
stecog
  • 2.4k
  • 11
  • 32
  • 39

Apache behind proxy: bypass Auth Basic for some ip

I need bypass basic auth to some ip, Apache is 2.4 and is behind haproxy, i have inserti this into Document Root section:

<Directory /path/to/webroot>
    AuthUserFile /etc/apache2/.htpasswd
    AuthType Basic
    AuthName "Restricted Content"
    <Limit GET>
        Require valid-user
    </Limit>
    Require ip xxx.xxx.xxx.xxx
    Satisfy any
</Directory>

But don't work, apache is behind a proxy, it probably will not work because the ip which comes to apache is the proxy and not the client