bindbn Asked: 2011-02-16 03:07:42 +0800 CST2011-02-16 03:07:42 +0800 CST 2011-02-16 03:07:42 +0800 CST Apache, use X-Forwarded-For for allow 772 How can use X-Forwarded-For headers(my proxy ip 10.1.1.x) to allow HTTP query? apache-2.2 mod-authz-host 3 Answers Voted Best Answer ooshro 2011-02-16T03:16:52+08:002011-02-16T03:16:52+08:00 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> Vicky Sridhar 2018-03-24T01:11:21+08:002018-03-24T01:11:21+08:00 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] ThatGraemeGuy 2011-02-16T03:23:39+08:002011-02-16T03:23:39+08:00 You can use mod_rpaf to make Apache treat the X-Forwarded-For IP as the client IP.
You can use SetEnvIf and Allow:
You can write a rewrite rule to redirect to 403 response.
You can use mod_rpaf to make Apache treat the X-Forwarded-For IP as the client IP.