Nginx/gitlab-ci-error.log overflowing with Host not found

My nginx/gitlab-ci-error.log is overflowing with messages like this:

2016/06/21 12:48:49 [error] 11431#0: *626 could not be resolved (3: Host not found), client:, server:, request: "POST /api/v1/builds/register.json HTTP/1.1", host: ""

In /etc/hosts I have defined and to both point to

This problem is so persistent, the drive for my logs is at risk of running out of space. Since all the hostnames resolve, I have no idea what the problem is. I have tried hunting down every possible reference to “” and change it to different values (then gitlab-ctl restart), but nothing seems to have any effect. I keep getting the same error message over and over.

Any ideas what causes this or how to troubleshoot further?