Webpack-dev-server的proxy用法

参考:https://segmentfault.com/a/1190000016314976

打包部署后代理会失效

参考:https://blog.csdn.net/Jesion_T/article/details/105360625?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-0&spm=1001.2101.3001.4242

解决方案 在nginx配置代理:我的配置

server {
            listen       81;
            #charset  utf-8;
            #client_max_body_size 1024m;

            location / {
            root   /root/workPlace/adminfont/dist;
            index  index.html;
            }

            location /api/ueditor {
                proxy_pass http://211.149.176.213:8092/api/ueditor;
                proxy_set_header Host $host:$server_port;
            }
}
⎛⎝官萧何⎠⎞一只快乐的爪哇程序猿;公司官网:www.csbwbd.com;邮箱:1570608034@qq.com
原文地址:https://www.cnblogs.com/guanxiaohe/p/14646570.html