Webpack dev server always reports error 404 when configuring reverse proxy. How to solve it?
Error log: GET http://localhost:8080/mzabris... 404 (Not Found)
Configuration file:
devServer: {
inline: true,
noInfo: true,
port: 8080,
proxy: {
'/mzabriskie': {
target: 'https://github.com',
changeOrigin: true
}
}
},
Interface code:
this.$http.get('/mzabriskie/axios').then((response) => {
console.log(response)
}).catch((error) => {
console.log(error)
})
There seems to be nothing wrong with the configuration, mainly because I seem to have written the wrong file....
There is absolutely no problem with your code...Have you restarted webpack after modifying the configuration?
Add a line
Then restart webpack