This post is to help out people trying to get nginx+php-fpm working with moodle.
I have ran into a few problems, so I thought I would share what I did that worked. I had to scrounge this information off the net from various places.
Note: this is still a work in process, so thorough client testing is not done yet. I will update if we run into any problems.
Setup is Ubuntu 11.04 server with nginx 1.08 from the stable ppa.
Using Moodle 2.1 latest from git. (Ask if I'm missing anything)
Here is the config I'm using: (at /etc/nginx/sites-available/default)
To kind of go over it, we're using forced ssl (hence the rewrite rule on port 80.)
The lines:
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
Were taken from: http://kbeezie.com/view/php-self-path-nginx/
This forces nginx to send the right PATH_INFO so that normal file uploads/downloads work with moodle. Before you would get a 404.
Note: I saw many places where you had to edit moodle code to get this to work. Either that was fixed, or they didn't know you could do it this way. I didn't edit any moodle code (other than the change mentioned at the bottom.)
The line:
fastcgi_read_timeout 600;
Makes nginx wait for moodle to finish long tasks (like restoring courses, etc.) Before it would just end at a blank screen.
The line:
client_max_body_size 10000M;
Allows for large uploads. This is in addition to the stuff you have to change in php.ini.
Finally for fastcgi to work correctly, you have to add this to your moodle's config.php:
$CFG->sslproxy=true;
That's really all I had to do to get it working. I'll post more as our situation changes.
Kory Prince