内网穿透报错 Invalid Host header

简介: 内网穿透报错 Invalid Host header

指向本地服务器访问时,webpack项目页面提示Invalid Host header.(无效的主机标头)

需要分两种情况解决,webpack4.0以下和webpack5.0

webpack4.0以下配置

//在webpack.dev.config.js文件
  devServer: {
    disableHostCheck: true,
  }

webpack5.0配置

在webpack 5 中disableHostCheck应该被遗弃了

查看文档了解到需将 disableHostCheck:true,替换为

historyApiFallback: true,

allowedHosts: “all”,

//webpack.dev.js文件
devServer: {
historyApiFallback: true,
allowedHosts: "all",
}
相关文章
Mac Source Tree拉代码报错,remote: CODING 提示: Authentication failed. remote: 认证失败,请确认您输入了正确的账号密码。 fatal...
Mac Source Tree拉代码报错,remote: CODING 提示: Authentication failed. remote: 认证失败,请确认您输入了正确的账号密码。 fatal...
1945 0
Mac Source Tree拉代码报错,remote: CODING 提示: Authentication failed. remote: 认证失败,请确认您输入了正确的账号密码。 fatal...
|
开发工具 数据安全/隐私保护 git
Git报错:remote: HTTP Basic: Access denied的解决方法
Git报错:remote: HTTP Basic: Access denied的解决方法
2090 0
Git报错:remote: HTTP Basic: Access denied的解决方法
|
2月前
|
安全 应用服务中间件 网络安全
修复HTTPS升级后出现 Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame 'http://xxx'. This request has been blocked; the content must be served over HTTPS. 的问题
修复HTTPS升级后出现 Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame 'http://xxx'. This request has been blocked; the content must be served over HTTPS. 的问题
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2
4459 0
|
4月前
|
JavaScript
NGROK——Invalid Host header
NGROK——Invalid Host header
62 0
|
7月前
|
缓存 网络安全 开发工具
Git服务器报错:host key for (ip地址) has changed and you have requested strict checking
Git服务器报错:host key for (ip地址) has changed and you have requested strict checking
543 0
|
网络安全 数据安全/隐私保护
【已解决】mac端 sourceTree 解决remote: HTTP Basic: Access denied报错
又是在一次使用sourcetree拉取或者提交代码时候,遇到了sourcetree报错; 排查了一会,比如查看了SSH keys是否有问题、是否与sourcetree账户状态有问题等等,最终才发现并解决问题
|
应用服务中间件
Error:Remote staging type or host is not specified.
Error:Remote staging type or host is not specified.
174 0
|
开发工具 数据安全/隐私保护 git
git 报错:remote: HTTP Basic: Access denied
git 报错:remote: HTTP Basic: Access denied
235 0
git 报错:remote: HTTP Basic: Access denied
|
应用服务中间件 nginx
Invalid Host header 服务器域名访问出现的问题
Invalid Host header 服务器域名访问出现的问题
2224 0
Invalid Host header 服务器域名访问出现的问题