cd /usr/local/nginx/conf
mkdir vhosts
cd vhosts
vim default.conf
server
{
listen 80 default_server;
server_name localhost;
index index.html index.htm index.php;
root /tmp/123;
deny all
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
}
}
mkdir /tmp/123
/etc/init.d/nginx reload 重新加载配置文件
标准配置
server
{
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /usr/local/nginx/html;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
}
}
本文出自 “10897714” 博客,请务必保留此出处http://10907714.blog.51cto.com/10897714/1731221
原文:http://10907714.blog.51cto.com/10897714/1731221