server {
listen 80;
server_name _;
access_log /data/wwwlogs/test.com_nginx.log combined;
index index.html index.htm index.php;
root /data/wwwroot/test;
#error_page 404 /404.html;
#error_page 502 /502.html;
location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ /\.ht {
deny all;
}
}
主要还是这句:fastcgi_pass unix:/dev/shm/php-cgi.sock;
PHP配置文件php-fpm.conf或者php-fpm.d下的www.conf
修改listen值:
listen = /dev/shm/php-cgi.sock
listen.owner = www
listen.group = www
listen.mode = 0660
修改用户:
user = www
group = www