Skip to content

Instantly share code, notes, and snippets.

@AdamGerthel
Last active December 21, 2015 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamGerthel/6218668 to your computer and use it in GitHub Desktop.
Save AdamGerthel/6218668 to your computer and use it in GitHub Desktop.
Apache mod_rpaf configuration used in combination with Varnish. When using Varnish the $SERVER variable remote_addr is set to the Varnish server IP instead of the client ip (site visitor). If Varnish is configured to send X-Forwarded-For headers containing the client IP, then mod_rpaf can use that information and set remote_addr to the client IP…
<IfModule rpaf_module>
RPAFenable On
# When enabled, take the incoming X-Host header and
# update the virtualhost settings accordingly:
RPAFsethostname On
# Define which IP's are your frontend proxies that sends
# the correct X-Forwarded-For headers:
RPAFproxy_ips 123.123.123.123 10.0.0.2 127.0.0.1
# Change the header name to parse from the default
# X-Forwarded-For to something of your choice:
RPAFheader HTTP_X_FORWARDED_FOR
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment