Apache的请求头丢失主机:,需要处理请求 [英] Apache request header missing Host:, need to process request

查看:1292
本文介绍了Apache的请求头丢失主机:,需要处理请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跟他们一个小小的http客户端多个设备。我们与我自定义的Web服务器进行了测试,一切都很好。现在我想迁移到Apache作为我的网络服务器,和我的要求也越来越关闭:

I have several devices with a tiny http client on them. We tested them with my custom webserver and all is good. Now I want to migrate to apache as my webserver, and my requests are getting shut down:

客户端发送的HTTP / 1.1请求没有hostname(参见RFC2616节14.23)

client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23)

我知道,因为我错过了主持人:www.blah.com出现此错误的条目在我的头。它的每个HTTP 1.1规范所要求

I know this error occurs because I'm missing the "Host: www.blah.com" entry in my header. It's required per HTTP 1.1 spec

RFC2616 14.23节
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

RFC2616 section 14.23 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

问题是我无法改变的硬件固件,所以HTTP客户端是它是什么。如果我是熟悉的前手这个要求,我会付诸实施。我的问题是:

The issue is I cannot change the firmware on the hardware, so the http client is what it is. If I were familiar with this requirement before hand, I would have implemented it. My question is:

我如何配置apache(我觉得authz_host模块),允许在没有主机请求:?在他们的头项

How can I configure apache (I think the authz_host module ) to allow requests with no Host: entry in their header?

推荐答案

直接的答案是,我不认为你可以让Apache忽略的协议。您的客户都断了。然而,思维外箱位,如果一切都失败了,也许你可以用Python语言编写一个小http代理这不只是解决您的HTTP请求,并送他们到适当的主机,并告诉你的客户使用代理。

The direct answer is that I do not think you can make apache ignore the protocol. Your clients are broken. However, thinking outside the box a bit, if all else fails, perhaps you could write a small http proxy in python which does nothing but fix your http requests and send them on to the proper host and tell your clients to use the proxy.

这篇关于Apache的请求头丢失主机:,需要处理请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆