You are going to need to use a module called fastcgi.
The docs are here FastCGI Module.
An example location
location / {
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
This will also require a fastcgi daemon running as well. Installation of this daemon depends on your os.
Here is another page on the wiki that talks about fcgi.