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;
            }
}

 

posted @ 2021-04-12 09:21  官萧何  阅读(300)  评论(1编辑  收藏  举报