Make random X-Forwarded-For header configurable.

The x-forwarded-for header was causing requests to fail on our systems when it contained a random IP address. This patch makes the feature configurable, with the feature being enabled by default for backwards compatibility.