Nginx itself does not handle the dynamic request, it will pass the request through fastcgi to php,php processing the generated static page and then handled by Nginx.
PHP-FPM is also a third-party fastcgi process Manager, which is developed as a patch for PHP, it also needs to be compiled with the PHP source code at the time of installation, that is, the PHP-FPM is compiled into the PHP kernel, so the performance of the processing is more excellent And it is also much better at handling high concurrency than the spawn-fcgi engine, so it is recommended that this combination of NGINX+PHP/PHP-FPM parse the PHP php5.3 the above version has integrated PHP-FPM into the PHP installation package, php5.2 and the following need to download the expansion pack http://php-fpm.org/downloads/.
server{
Server_namewww.mysite2.name;
return301 $scheme://mysite2.name$request_uri;
}
server{
server_name mysite2.name;
root/usr/share/nginx/mysite2.name/live/;
indexindex.html index.htm index.php;
location/{
Try_files$uri $uri//index.html index.php;
}
location~ \.php$ {
fastcgi_split_path_info^ (. +\.php) (/.+) $;
Fastcgi_passunix:/var/run/php5-fpm.sock;
fastcgi_indexindex.php;
Includefastcgi_params;
}
}
Integrated Nginx and PHP configuration