Daniele
Daniele

Reputation: 847

webpack devServer and proxy shows a 404 page

where am I supposed to connect when I proxy to an third domain like that ?

module.exports = {

  ...
  devServer: {
    proxy: {
      "/": {
        target: "http://www.example.org",
      },
      changeOrigin: true
    }
  }
  ...
}

shouldn't localhost:8080 show http://www.example.org content ?

because I get a 404 page... (the same is true with other sites, I get not-founds, or even apache install pages!)

Upvotes: 1

Views: 2882

Answers (1)

Daniele
Daniele

Reputation: 847

this is the right configuration

module.exports = {
...
devServer: {
  proxy: {
    "/": {
      target: "http://www.example.org",
      changeOrigin: true
    },
  }
}
...
}

Upvotes: 2

Related Questions