1.打开nginx配置文件 vim /etc/nginx/nginx.conf
server {
listen 80; #端口号
server_name www.yangcz.com; #站点域名
root /var/www/html; #站点读取目录
index index.html index.htm index.php; 默认读取文件
localtion / {
}
location ~ .php${
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name; #站点会以这里为标准读取
include fastcgi_params;
}
error_page 404 /404.html;
location = /40x.html{
}
error_page 500 502 503 504 /50x.html
location = /50x.html{
}
}
2.重启nginx服务 service nginx restart