简单的利用nginx部署前端项目

  1. cd /etc/nginx
  2. cd conf.d/
  3. pwd

            default.conf: 前端nginx配置

         4.vim/vi  default.conf

         5添加nginx配置(按向下的箭头)

   location / {

      Root /home/shanghai_frontpage;

      Index index.html index htm;

}

6.保存:

:q!   不保存退出

wq  保存退出

 

7.重启nginx :  systemctl restart nginx

 

命令:

systemctl status nginx: 查nginx服务状态

:q!   不保存退出

wq保存退出

 

pwd: 用于显示工作目录,执行pwd指令可立刻得知目前所在的工作目录的绝对路径

i :切换到输入模式,以输入字符

x : 删除当前光标所在处的字符

vi: 打开文件

shift+g直接跳到最后一行;