内网穿透报错 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",
}
相关文章
|
应用服务中间件 nginx
HOST 碰撞
HOST 碰撞
71 0
|
网络安全 开发工具 git
Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa(解决的两种方式)
Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa(解决的两种方式)
3764 0
Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa(解决的两种方式)
|
1月前
|
安全 关系型数据库 MySQL
bah-host碰撞-pspy+sheallinabox
bah-host碰撞-pspy+sheallinabox
18 1
|
1月前
|
安全 应用服务中间件 网络安全
修复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. 的问题
|
2月前
|
网络安全
出现“Host key verification failed”错误--解决
遇到“Host key verification failed”错误,通常是因为远程主机密钥发生变化,与本地保存的信息不符。这种情况可能是远程主机系统更改或重装等原因导致的。解决方法是根据提示使用`ssh-keygen -f "/root/.ssh/known_hosts" -R "[10.61.0.152]:29022"`命令移除旧的密钥信息,然后重新尝试连接。
547 5
|
3月前
|
JavaScript
NGROK——Invalid Host header
NGROK——Invalid Host header
49 0
|
6月前
|
缓存 网络安全 开发工具
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
534 0
|
应用服务中间件
Error:Remote staging type or host is not specified.
Error:Remote staging type or host is not specified.
160 0
|
Java Spring
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
3528 1
Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings解决办法
服务器重启后 Host key verification failed
服务器重启后 Host key verification failed
146 0
服务器重启后 Host key verification failed