Page 1 of 1

Problem forwarding RemoteIP from proxy to apache (mod_rpaf)

Posted: Tue Jan 06, 2015 1:40 pm
by joschi
Hey everyone and happy new year :)

i have a problem with forwarding the remote ips from nginx to apache:

ive added the following lines to the configuration templates of nginx under /usr/local/vesta/data/templates/web/nginx

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

then i enabled mod rpaf with the following config

<IfModule rpaf_module>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 ::1
RPAFproxy_ips my.serverIP.stands.here
RPAFheader X-Real-IP
</IfModule>

still only the server ip shows up in logs... did i do something wrong?
any help on this topic is highly appreciated!

kind regards
patrick

Re: Problem forwarding RemoteIP from proxy to apache (mod_rp

Posted: Tue Jan 06, 2015 2:03 pm
by joschi
ive found a workaround with remoteip:

1) a2enmod remoteip
2) create an config file under /etc/apache2/mods-available named remoteip.conf
3)add the following lines
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 127.0.0.1 your.proxy.server.ip
4) link the file under /etc/apache2/mods-enabled
5) service apache2 restart

it should work then for php