How can use X-Forwarded-For headers(my proxy ip 10.1.1.x) to allow HTTP query?
Asked
Active
Viewed 3.7k times
3 Answers
25
You can use SetEnvIf and Allow:
<Location "/only_proxy/">
SetEnvIf X-Forwarded-For ^10\.1\.1\. proxy_env
Order allow,deny
Satisfy Any
Allow from env=proxy_env
</Location>
ooshro
- 11,502
4
You can write a rewrite rule to redirect to 403 response.
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-For} !(1.1.1.1|2.2.2.2)
RewriteRule .* - [F]
Jenny D
- 28,400
- 21
- 80
- 117
2
You can use mod_rpaf to make Apache treat the X-Forwarded-For IP as the client IP.
ThatGraemeGuy
- 15,788