- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们最近将 ASP.NET MVC 5 应用程序迁移到 ASP.NET Core 2.2。
一切似乎都工作正常,但是我们经常收到以下异常(大约每秒三次,稍后会详细介绍):
BadHttpRequestException: Invalid Host header: '~^appname.*$'
Module "Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException", line 0, col 0, in Throw
Void Throw(Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.RequestRejectionReason, System.String)
Module "Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection", line 95, col 0, in EnsureHostHeaderExists
Void EnsureHostHeaderExists()
Module "Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection", line 196, col 0, in TryParseRequest
Boolean TryParseRequest(System.IO.Pipelines.ReadResult, Boolean ByRef)
Module "Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol+<ProcessRequests>d__185`1", line 170, col 0, in MoveNext
Void MoveNext()
Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", line 12, col 0, in Throw
Void Throw()
Module "System.Runtime.CompilerServices.TaskAwaiter", line 46, col 0, in HandleNonSuccessAndDebuggerNotification
Void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
Module "Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol+<ProcessRequestsAsync>d__184`1", line 135, col 0, in MoveNext
Void MoveNext()
在咨询我们的运营团队成员后,很明显我们有三个 HAProxy 实例,大约每秒检查一次应用程序的每个节点。
对此应用程序的每个请求都将按如下方式流动:
HAProxy -> Nginx -> Kestrel/ASP.NET Core 应用程序
我的问题是,我如何确定这里发生了什么?
最佳答案
当前版本的 Kestrel(我们使用的是 ASP.NET Core 2.2)不支持 HTTP 访问日志记录。
查看此问题:Support access logging with Common Log Format/Extended Log Format
为了追踪问题,我必须让我们的运营团队检查我们的 nginx 日志(nginx 是我们正在使用的反向代理),以确定带有无效主机 header 的请求来自何处。
问题原来是状态检查应用程序配置错误。
关于asp.net-core - Kestrel 在提供流量时抛出 "Invalid Host header"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56136772/
Windows“主机”文件编码是什么?是UTF-8吗?还是 ASCII + 系统代码页?应如何添加 IDN(带有变音符号等的国际域名)条目以及它们是否可以添加? 最佳答案 它应该是没有 BOM 的 A
我已经在谷歌上搜索了大约 90 分钟,但仍然没有答案。在哪里设置 default_url_options?我已经将其设置为 config.action_mailer.default_url_optio
我正在从它的样式文件中设计一个 Angular 组件,我发现我必须使用 :host ,:host() 或 :host-context selector ,它们各自有什么不同? 最佳答案 :主机 是用于
我正在创建简单的网络应用程序。而且我在服务器配置方面遇到了问题。当我尝试启动服务器时,收到错误消息 The element type "Host"must be terminated by the m
这个有效: 127.0.0.1 www.somesite.com 但不是这个: 127.0.0.1/somepath/www www.mysite.com 我做错了什么?是否可
我必须查看我的前同事留下的一些脚本,我很好奇为什么他在参数中使用 $a = $(Read-Host -Prompt "Write Something")节而不是 $a = (Read-Host -Pr
我在远程连接到 MySQL 服务器时遇到问题。我知道我的用户设置了来自任何主机的“%”通配符,因此我应该有权访问服务器。我可以使用我的凭据本地登录 MySQL 服务器,但不能远程登录。 我在 my.c
我正在尝试使用 angular 2 构建一个双主题应用程序。有问题的组件 css 已经使用 :host/deep/强制对子组件进行样式设置。 但是我正在尝试根据 html 主题切换此样式,并且我正在使
我需要将特定的传出连接(从我系统上的任何 网络客户端)重定向到特定的 IP。是的,可以通过在 /etc/hosts 文件中添加这一行来完成: 123.456.789.012 www.mydomain
尝试在开发中预览我的邮件程序,但出现上述错误。(使用 Michael Hartl 教程)。 我相信它因为我的主机而无法正常工作。但是,使用 cloud 9 我很难找到我的主机。在书中,它被定义为 Cl
nc 当我在虚拟机上执行它时工作正常。 Connection to 10.0.0.10 22 port [tcp/ssh] succeeded! 但是当我在 docker 容器内执行相同的命令时,它会
我正在学习PowerShell,想知道两者之间的区别 Read-Host -Prompt "Text" 和 Read-Host "Text" 是同一件事还是我没有看到的区别? 最佳答案 这是同一件事。
我无法对 Cassandra 节点进行查询。我能够连接到集群并进行连接。然而,在执行查询时,它失败了 Caused by: com.datastax.driver.core.exceptions.No
我有这样的场景,比如我需要运行一个位于 12.34.567 的 API curl 请求,登录后我必须再登录一台主机 98.76.543。 登录到第二个主机后,我必须运行curl -XPOST -H"C
当我尝试 git push -u origin master到我的存储库,我得到 400 Bad Request .我特意用 编辑了一些信息。 最近从 gitlab-ee 中解绑了 nginx,并验
假设我有某个程序的源代码,源代码使用 GNU autotools,为了简单起见,假设该程序绝不是任何类型的开发工具。如果我手边有交叉工具链,我可以使用 --host configure 为平台 foo
在我的 ASP.NET Core 2.0 项目中,我一直在使用 Microsoft.Extensions.Hosting 命名空间中的 IHostingEnvironment 和 IApplicati
我正在使用以 Python3.6 为基础的 docker 镜像。突然间它开始崩溃(启动后立即退出)。所以我冲进了容器,发现它崩溃是因为与容器化 postgres 数据库的连接突然失败。我设法得到的唯一
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我尝试使用 ssh命令连接到另一个远程主机。 ssh -p 21098 -i $OPENSHIFT_DATA_DIR/.ssh/host_key user@domain.com The authe
我是一名优秀的程序员,十分优秀!