内网穿透报错 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",
}
相关文章
Rejected request from RFC1918 IP to public server address
Rejected request from RFC1918 IP to public server address
4786 0
|
1月前
|
JavaScript
NGROK——Invalid Host header
NGROK——Invalid Host header
32 0
|
4月前
|
缓存 网络安全 开发工具
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
505 0
|
11月前
|
网络协议 Docker 容器
登录私有镜像仓库报错:Error response from daemon: Get https://dockerhub.thecloud.ink/v2/: dial tcp: lookup dock
登录私有镜像仓库报错:Error response from daemon: Get https://dockerhub.thecloud.ink/v2/: dial tcp: lookup dock
390 0
|
应用服务中间件
Error:Remote staging type or host is not specified.
Error:Remote staging type or host is not specified.
135 0
|
应用服务中间件 Linux BI
Tomcat部署iframe出现Refused to display ‘url‘ in a frame because it set ‘X-Frame-Options‘ to ‘deny‘无法访问问题
Tomcat部署iframe出现Refused to display ‘url‘ in a frame because it set ‘X-Frame-Options‘ to ‘deny‘无法访问问题
640 0
Tomcat部署iframe出现Refused to display ‘url‘ in a frame because it set ‘X-Frame-Options‘ to ‘deny‘无法访问问题
服务器重启后 Host key verification failed
服务器重启后 Host key verification failed
132 0
服务器重启后 Host key verification failed
|
应用服务中间件 nginx
Invalid Host header 服务器域名访问出现的问题
Invalid Host header 服务器域名访问出现的问题
2020 0
Invalid Host header 服务器域名访问出现的问题
|
应用服务中间件 nginx
启动nginx报错,80 failed (97: Address family not supported by protocol)
启动nginx报错,80 failed (97: Address family not supported by protocol)
375 0
启动nginx报错,80 failed (97: Address family not supported by protocol)
|
网络安全 PHP
PHP函数file_get_contents()使用 https 协议时报错:SSL operation failed
报错提示: 总之就是https报错,采集不到数据
186 0