Fix USE_X_FORWARDED_FOR for proxied environments

The settings for USE_X_FORWARDED_FOR were not being respected because the settings were not being passed through.