diff --git a/src/eventlog.js b/src/eventlog.js index 4c17cac06..000b46cfa 100644 --- a/src/eventlog.js +++ b/src/eventlog.js @@ -63,7 +63,7 @@ function add(action, req, data, callback) { callback = callback || NOOP_CALLBACK; var id = uuid.v4(); - var source = { ip: req.ip || null, username: req.user ? req.user.username : null }; + var source = { ip: req.headers['x-forwarded-for'] || req.ip || null, username: req.user ? req.user.username : null }; eventlogdb.add(id, action, source, data, function (error) { if (error) return callback(new EventLogError(EventLogError.INTERNAL_ERROR, error));