前端生产环境部署(centos7)

JooLun 3月前 ⋅ 13069 阅读

一、安装nginx(自行百度)

二、用户WebStorm打包

npm run build

三、上传打包后的dist文件夹到/mnt/install/joolun-ui/目录下

四、修改nginx配置

# vi /usr/local/nginx/conf/nginx.conf

        # 讲打包好的dist目录文件,放置到这个目录下
        root /mnt/install/joolun-ui/dist/;
              
        location ~* ^/(code|auth|admin|gen|wxmp) {
           proxy_pass http://127.0.0.1:9999;
           #proxy_set_header Host $http_host;
           proxy_connect_timeout 15s;
           proxy_send_timeout 15s;
           proxy_read_timeout 15s;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

五、启动nginx

# systemctl start nginx.service


全部评论: 0

    我有话说: