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

相关文章:

  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-10
  • 2021-04-17
  • 2021-10-04
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
相关资源
相似解决方案