Marco Bravo

Logo

Marco Bravo's DEV Profile If you don’t know, ask – if you know, share! ~ opensource mindset Baseball ball image


➠ "We may not have control over our circumstances, but we do have control over our minds"
➠ What do I want to do next?
Cloud and rainbow image

View My GitHub Profile

4 March 2020

Apache X-Forwarded-For

by Marco Bravo

Apache support image

When configuring Apache X-Forwarded-For take in consideration the differences for Apache versions 2.2 and 2.4.

Example to allow specific IP addresses (Apache 2.4):

<Location "/restricted-path">
    SetEnvIF X-Forwarded-For "1.1.1.1" AllowIP
    SetEnvIF X-Forwarded-For ^10\. AllowIP

    <RequireAny>
        Require env AllowIP
    </RequireAny>
</Location>

References:

Full article

tags: apache - logs - config - forwarded