This was originally created as a workaround to the generally-unlikely case of needing Nginx to perform authentication via PAM as a separate process, possibly as a different user, similar to how Apache's mod_authnz_external might be used with pwauth.
This is a simple PAM authentication interface (harvested from a variety of mod_pam-style sources), wrapped up behind libfcgi. The primary intent is for it to get invoked as an internal location via an auth_request during the course of handling a query.
Have libfcgi installed, tweak Makefile, build, invoke as fastcgi (perhaps with spawn-fcgi).