It seems to me that SCRIPT_FILENAME is the key w/ PHP-FPM, but I could be wrong.
Also, the fact that different methods of invoking FCGI result in different vars, at 1st blush, doesn't seem "incorrect" assuming that each difference makes some sense, in a way. Finally, I think that instead of trying to address these in the various proxy modules/submodules, etc, we should do so in util_script.c instead. One central place where we "canonically" set these params, and handle the different ways r->filename may be mangled ;)