Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for X-Forwarded-For #26

donum opened this Issue Mar 20, 2015 · 4 comments


None yet
3 participants
Copy link

donum commented Mar 20, 2015


in your description it says:

This module uses the client IP address for the lookup. This is not always what you want. If you need to use an IP address specified in a header (e.g., by your proxy frontend), mod_remoteip may be used to set the client IP address.

However, the still wildly used Apache 2.2 doesn't include mod_remoteip.

I also see in your code:

static char *get_client_ip(request_rec *r)
    return r->useragent_ip;
# else
    return r->connection->remote_ip;

You tried to support both but the condition are commented out.

Could you please add support for 2.2 in this regard? Especially it would be cool if there were a config setting so that the module uses the client ip coming from the X-Forwarded-For header.

What do you think? We tried using a downgrade version of mod_remoteip which initially worked, but gives us SIGTERMs.

We would like to use a commercial license from you, but this technical issue is blocking us right now.



This comment has been minimized.

Copy link

oschwald commented Mar 20, 2015

That code isn't commented out. It is a preprocessor directive. For 2.2, you can use a backported version of mod_remoteip such as mod_remoteip-httpd22, which is what we use in our unit tests, or something like mod_rpaf may work as well.


This comment has been minimized.

Copy link

donum commented Mar 20, 2015

Oh sorry, I am not familiar with c. Thanks, I will check the links and respond later. mod_rpaf sounds really promising.


This comment has been minimized.

Copy link

tewner commented Oct 7, 2015

This feature was added in mod_geoip2 , including a feature we requested, "GeoIPUseFirstNonPrivateXForwardedForIP". We would like to stop using the "Legacy" MaxMind DB's, but would also prefer not to have this "regression".


This comment has been minimized.

Copy link

oschwald commented Oct 7, 2015

Is there a reason why you can't use mod_remoteip? Parsing various headers seems out of scope for this module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.