Invalid Host header 服务器域名访问出现的问题

  1. 关闭host检查
module.exports = {
devServer: {
// https://webpack.docschina.org/configuration/dev-server/#devserverdisablehostcheck
disableHostCheck: true,
},
};
  1. 修改host为对一个的域名
module.exports = {
host: "xxx.com",
};