nginx设置默认首页
nginx不仅可以做反向代理,而且还能做web server。
打开配置文件,设置自己主页的路径,和主页名称。
cd /usr/local/nginx/conf
vi nginx.conf
# 配置nginx
listen 8080;
location / {
index myhome.html;
root root/home;
}
重新启动一下,这样子我们的配置才可以生效。
# 启动nginx
cd usr/local/nginx/sbin
./nginx
# 重启nginx
cd /usr/local/nginx/sbin
./nginx -s reload
# 解决权限问题 chmod -R 755 /root/home
原文:https://www.cnblogs.com/hnxxcxg/p/12848343.html