To detect if a connection was closed by a client, nginx uses:
  • A EV_EOF flag as reported by kqueue. This only works if you use kqueue, i.e. on FreeBSD and friends.