So recently I decided to switch from Apache 2.4 to Nginx, largely for better performance. I also wanted to get a new site going that would be written in Perl and served by FastCGI, as well as support my current wordpress sites.
The PHP portion of the configuration was easy as pie. I installed and configured php-fpm, and after a few tweaks everything was working as before (except slightly faster). So far so good.
Perl hasn't been quite as easy to set up. I feel a bit like someone falling down a tree and getting his nuts smashed by every branch on the way down, if you'll pardon the expression. However I'm now at a point where I've tried every fix for my remaining problem and the test page is still not up and running.
My setup is as follows: Amazon Linux AMI running in EC2, have installed nginx, perl and spawn-fcgi from the repository, have compiled and installed fcgiwrap.
Nginx, php-fpm, and spawn-fcgi/fcgiwrap are all set to run as www-data:www-data and execute as daemons.
For the defined web roots I have made sure that all the directories all the way to root are o+x, and the web, log and other directories (e.g. /var/lib/nginx) themselves are owned by www-data:www-data. All FCGI requests are communicated through a socket file, both for php-fpm and fcgiwrap, although different sockets are used. Oddly enough the php-fpm socket appears to be owned by root:root while the fcgiwrap socket is owned by www-data:www-data. Things have been configured largely as per the instructions here:
http://www.howtoforge.com/serving-cgi-scripts-with-nginx-on-centos-6.0-p2
And still all I get when I try to hit my test page is "403: forbidden". It states just that in smallcaps -- View Source shows nothing else than that one line -- so this is not the standard NGINX error page. I have tried tailing the error log while making the request, but nothing gets added (like there's effectively no error), nor can I find anything relevant in /var/log/messages.
I'm getting to my wits' end trying to diagnose this. As I mentioned I've tried a lot of the fixes one can find with a google search, but nothing has resolved the issue so far. Can anyone suggest something I might be missing?