修改的配置文件主要在两个目录里
/usr/local/nginx/conf
/usr/local/nginx/conf/vhost
lnmp vhost add 添加完后,修改域名配置文件
root /home/wwwroot/域名目录/public; //工作目录配置到public
修改fastcgi.conf
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=document_root/../:/tmp/:/proc/";
配置站点的Conf文件, 在vhost文件夹中, 默认站点在nginx.conf. 添加以下代码
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=/$1 last;
}
}
同时把
include enable-php.conf; 改为
include enable-php-pathinfo.conf;
最后别忘了重启nginx