Apache 2.4 – htaccess Allow IP From Header X-Forwarded-For behind Proxy / Load Balancer / AWS ELB

Apache 2.4 – htaccess Allow IP From Header X-Forwarded-For behind Proxy / Load Balancer / AWS ELB

In .htaccess file

SetEnvIF X-Forwarded-For "1.1.1.1" AllowIP
SetEnvIF X-Forwarded-For "2.2.2.2" AllowIP

Require env AllowIP