I have log_format to log user id
http { log_format custom \'ip: $remote_addr, user_id: $sent_http_x_user_id\'; access_log /var/log/nginx/access.log custom; }