I am using directory listing from specific IP ranges. Recently, we moved the web server to AWS and using ELB. Now, even I am in IP range the Apache say's forbidden access. Anyone can help me?
Asked
Active
Viewed 1,024 times
2 Answers
2
If you have any proxy or ELB between Client and WebServer the visible IP to WebServer will be that proxy/ELB IP. In that scenario you can limit access through X-Forwarded-For
IP.
Here are some example:
Apache 2.4
SetEnvIf X-Forwarded-For "202.12.32.1" allowed_list
SetEnvIf X-Forwarded-For "202.32.32." allowed_list
Require env allowed_list
Apache 2.2
SetEnvIf X-Forwarded-For "202.12.32.1" allowed_list
SetEnvIf X-Forwarded-For "202.32.32." allowed_list
Order deny,allow
Deny from all
Allow from env=allowed_list

Sourav
- 1,343
0
Enable and configure mod_remoteip. You will need to identify the IP addresses used by ELB. (Or you could allow anyone to spoof X-Forwarded-For, but use some firewall facility to block accesses to your webserver which do not come from the ELBs. Maybe Amazon has such a feature).

sourcejedi
- 50,249
DirectoryIndex
enabled for a specific Directory and he want to limit access to that directory. – Sourav Jun 20 '17 at 20:20