Vue Nginx 发布部署

  1. 安装部署Nginx:Nginx windows 安装部署
  2. 编译Vue程序:npm run build 
  3. 生成dist文件夹里面的文件如下:
  4. 将dist文件夹拷贝到:D:\nginx-1.18.0\html目录下面
  5. 配置:D:\nginx-1.18.0\conf\nginx.conf文件
    
    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        server {
            listen       8088;//配置访问端口
            server_name  localhost;
    
     	    location / {
                //配置文件路径
                root   D:/nginx-1.18.0/html/dist;
                index  index.html index.htm;
            }
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    }
    

     

  6. 配置完成,运行:http://localhost:8088 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值