It seems like the init_module callback is not executed in nginx's master process. At least, I've printed a call to getpid() and the pid returned was that of a process that wasn't running, which makes me think it is executed in a process that forks the master process itself.