Added check for reverse proxy

Added a check to see if the service is behind a apache reverse proxy and get the client IP from the X-Forwarded-For header