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

Updating remote IP on keep alive connections fails #35

Closed
vincentwolsink opened this issue Nov 11, 2015 · 3 comments
Closed

Updating remote IP on keep alive connections fails #35

vincentwolsink opened this issue Nov 11, 2015 · 3 comments

Comments

@vincentwolsink
Copy link

We are using mod_rpaf 0.8.4 stable with Apache 2.2 on Debian Wheezy.

It updates remote IPs correctly most of the time. But when using keepalive connections it fails to do so for multiple requests using the same connection.

As you can see below in a (somewhat obfuscated) snippet of the access logs, the X-Forwarded-For header is correctly send and received as both log lines have the remote IP present "194.250.97.243".

domainname.com 194.250.97.243 - - [11/Nov/2015:11:26:22 +0100] "GET /bijlagen/19015.pdf HTTP/1.1" 206 46565 "https://domainname.com/index.php?view=aanvragen&layout=pt" "Mozilla/5.0 (Windows NT 6.0; rv:32.0) Gecko/20100101 Firefox/32.0" "-" "194.250.97.243" 194.250.97.243 pid:21224 1794 0 0 0 0
domainname.com 10.2.1.210 - - [11/Nov/2015:11:26:22 +0100] "GET /bijlagen/19015.pdf HTTP/1.1" 206 65536 "https://domainname.com/index.php?view=aanvragen&layout=pt" "Mozilla/5.0 (Windows NT 6.0; rv:32.0) Gecko/20100101 Firefox/32.0" "-" "194.250.97.243" 10.2.1.210 pid:21224 1850 4000 0 0 0

Our log format is as shown below.

"%{HOST}i %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{VIA}i\" \"%{X-FORWARDED-FOR}i\" %a pid:%P %D %{ACC_utime}n %{ACC_stime}n %{ACC_cutime}n %{ACC_cstime}n"

Our mod_rpaf config is below.

<IfModule rpaf_module>
        RPAF_Enable             On
        RPAF_ProxyIPs           127.0.0.1 10.0.0.0/8
        RPAF_SetHostName        On
        RPAF_SetHTTPS           On
        RPAF_SetPort            On
</IfModule>

When we force-close every connection on the HAProxy side, everything works like it should, because connections are no longer reused. But that means we cannot use keep alive.

If I need to provide more information, please let me know.

@mpdude
Copy link
Contributor

mpdude commented Nov 11, 2015

Does this commit 71a17f2 from the master branch solve your problem?

@vincentwolsink
Copy link
Author

I missed that one. It indeed seems to fix our issues. Thanks @mpdude!

@mpdude
Copy link
Contributor

mpdude commented Nov 18, 2015

:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants