nginx项目部署(前端)

1、工具

xshell xftp
将打包的dist中的文件通过xftp上传到对应的文件夹下(参考:本人做过的几次都在/usr/local/nginx/html),然后找到nginx.conf(参考:本人的在/usr/local/nginx/conf),打开nginx.conf修改里面的

server {
        listen       8080;//此处需要改成需要的,默认8080
        server_name  localhost;

        root /usr/local/nginx/html;//对应上传的文件夹的位置

        index  index.html index.html;
           	try_files $uri /index.html;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            #root   /home/msfsw-manage/msfsw-manage-front;
            #index  index.html index.htm;
        }
        }

2、重启命令

在xshell中输入下边代码进行重启(之前的没关掉的时候使用,关掉的直接使用启动命令)

/usr/local/nginx/sbin/nginx -s reload -c /usr/local/nginx/conf/nginx.conf

3、启动命令

在xshell中输入下边代码进行启动

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

4、在浏览器中进行查看

输入部署时的网址加上8080
eg:http://xxx.xxx.xxx.xxx:8080/

做一个小笔记方便下次遇到有忘记 艾玛的菜鸟

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值