为了账号安全,请及时绑定邮箱和手机立即绑定

修改nginx默认web目录的求助

修改nginx默认web目录的求助

千巷猫影 2018-11-28 02:01:10
修改nginx默认web目录的求助
查看完整描述

1 回答

?
慕的地8271018

TA贡献1796条经验 获得超4个赞

默认网站根目录为/usr/local/nginx/html,要将它改成/homw/www
vi /usr/local/nginx/conf/nginx.conf
将其中的
location / {
root html;
index index.php index.html index.htm;
}
改为
location / {
root /home/www;
index index.php index.html index.htm;
}
然后再将
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
改为
location ~ \.php$ {
root /home/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
然后重启nginx
已经安装了samba,所以要将vi /etc/samba/smb.conf中的[public]下的path值改为
path = /home/www/



查看完整回答
反对 回复 2018-12-19
  • 1 回答
  • 0 关注
  • 639 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信