0

当我代理到这样的第三个域时,我应该在哪里连接?

module.exports = {

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

不应该localhost:8080显示http://www.example.org内容?

因为我得到一个 404 页面......(其他网站也是如此,我得到未找到,甚至是 apache 安装页面!)

4

1 回答 1

0

这是正确的配置

module.exports = {
...
devServer: {
  proxy: {
    "/": {
      target: "http://www.example.org",
      changeOrigin: true
    },
  }
}
...
}
于 2017-08-16T21:38:30.613 回答