Update: this looks like a good article describing a verification scheme http://www.stavros.io/posts/writing-an-nginx-authentication-...