I want to run a (compiled) C program every time Nginx receives a request for a URL, say https://myserver.com/programs/my-C-file.
More specifically, when a PR in GitHub is merged, I want a hook to initiate a custom build and release process written in C (I want to use C because the build process is complex. There are many steps and and it's easier to parse stdout in C than Bash or PHP.)
But is there any reason I should use FastCGI to trigger the C binary directly instead of a PHP file and
exec('my C program')?
I'm obviously not getting more than a few of these every few days so I'm not worried about scaling up, and it seems like FastCGI is a lot of extra configuration whereas PHP I can use right out of the box. Just create a PHP file run
exec() and create a block in Nginx.
Or maybe I'm thinking about this whole process wrong and there's an easier way to do this.