아파치x-전달-for 사용

아파치x-전달-for 사용

'LocationMatch'가 가능하고 Apache 2.4가 x-forwarded-for IP 주소를 사용하도록 할 수 있습니까? 이에 대해 'mod_rpaf' 또는 'mod_remoteip'을 사용할 수 없습니다.

작동 중인 x-forwarded-for IP를 사용하도록 'apache.conf' LogFormat을 구성했지만 Apache 'LocationMatch'가 여전히 LoadBalancer IP를 가져오고 있습니다.

<LocationMatch "(?i).*/CFIDE">
Order Deny,Allow
Deny from all
Allow from 10.0.0.0/8 # I need this 'Allow' to use the x-forwared-for IP
</LocationMatch>

답변1

나는 'SetEnvIF X-FORWARDED-FOR'을 사용하여 내 문제를 해결했습니다.

<LocationMatch "(?i).*/CFIDE">
SetEnvIF X-FORWARDED-FOR "123.456.654.321" AllowIP
Order Deny,Allow
Deny from all
Allow from env=AllowIP
</LocationMatch>

관련 정보