Use webpack to configure proxy to proxy interfaces always report 404?

1. The data interface is http://www.xxx.com/api.paper/ data under this interface, I use webpack-devServer to configure proxy, but error 404not found is reported on the page.

2.proxy: {

        "/manage" : {
            target: "http://www.xxxx.com/",
            changeOrigin : true
        }
    }
   

this is the configuration of webpack.
use the ajax,url parameter of jquery to send a request. It says "/ manage/api/paper/"

.

then I rudely changed the "/ manage" in proxy to "/". What is written in target is that the complete interface url, page can get the data. But this is not appropriate! God, help me.


pathRewrite: {

                '^/manage': ''
            }

'/api' : {
            target: 'http://www.xxxx.com/',
            changeOrigin : true
        }

write like this, match the route of / api,

Menu