centos7修改nginx默认网站目录
想修改nginx的默认网站目录,百度了一大圈都没找到满意的
通过宝塔安装的nginx,进入配置文件目录:/www/server/nginx/conf/
修改nginx.conf,找到http,server,加入:
server { listen 80; server_name localhost; location / { root /www/wwwroot/default; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /www/wwwroot/default; } }
/www/wwwroot/default为你想要改成的默认网站目录,后面不带“/”
保存,重载nginx服务即可。
相关推荐
岁月如歌 2020-04-25
Andrea0 2019-12-02
linuxisperfect 2007-09-03
ruanchengmin 2016-11-22
michealming 2011-04-11
ach 2010-02-26
jsjbkshz0 2016-11-22
cocleon 2019-06-28
韩吉鑫 2019-06-26
xiaocao 2016-06-30
qiuqiang 2016-03-22
晴天哥 2008-01-24
qiuqiang 2013-07-01
yingking00 2012-11-11
email 2011-06-16
bocaimomo 2009-10-10