为什么存在 Server HTTP 标头?

发布于 2024-07-19 04:49:50 字数 67 浏览 3 评论 0原文

服务器 HTTP 响应标头有什么用? 我还没有真正看到它的用途。 为什么请求网页的人需要知道网页托管在哪台服务器上?

What is the Server HTTP response header useful for? I have yet to actually see a use for it. Why would someone that's requesting a webpage need to know what server a webpage is hosted on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

私藏温柔 2024-07-26 04:49:50

这让我想起了我编写的第一个 HTTP 服务器,它(显然)返回了服务器标头: 你为什么想知道?

这个问题的一个可能的答案是“因为我正在做一项调查” ”。 例如,如果没有服务器标头,这是不可能的

This has reminded me of the first HTTP server I wrote, which (obviously) returned the server header: Why do you want to know?

One possible answer to this question is "Because I'm doing a survey." For example, this would be impossible without the Server header.

无畏 2024-07-26 04:49:50

服务器并不意味着提供资源的服务器。 用于宣传实施。 至于它的实用性,这是一个很好的问题。 Apache httpd 可以配置为不包含该标头,因为它可以被视为安全问题。

Server doesn't mean the server that the resource is served from. It's for advertising the implementation. As to its utility, that's a good question. Apache httpd can be configured not to include that header, since it can be considered a security issue.

温柔戏命师 2024-07-26 04:49:50

有趣的问题。 在某种程度上,它最初可能被视为一种功能设备,类似于请求上的用户代理(browscap 等)。 实际上,这两种方法在这方面都没有真正的用处,并且大多数代码现在使用其他方法来测试选项。 并且在许多方面,服务器(间接)控制着来自行为良好的客户端的请求(如果至少有影响因素的话)。

如今,它有时被视为一个安全问题,而且我知道很多地方都在 html 流量上阻止此标头。 但对于非 html(但仍然是 http)流量(例如 Web 服务),它仍然可以起到有用的版本控制目的(尽管在这种情况下您经常会看到特定于产品的版本控制标头)。

Interesting question. At one level, perhaps it was originally seen as a capability device, similar to the user-agent on the request (browscap etc). In reality, neither is really useful in this respect, and most code now uses other means to test for options. And in many ways the server is (indirectly) in control of the requests from well-behaved clients (if has an influencing factor, at least).

These days, it is sometimes seen as a security issue, and I know many places that block this header on html traffic. But for non-html (but still http) traffic (such as web-services) it may still serve a useful versioning purpose (although you often see a product-specific versioning header in such cases).

空宴 2024-07-26 04:49:50

标头的唯一目的似乎是安全扫描仪并调查每台服务器拥有多少市场份额。 在 Apache 中,不可能完全删除标头,只能将其设置为最小,以便它只宣传“Apache”。 人们需要修补二进制文件以将其完全删除或自行重新编译。

我认为使用 IIS 也不能直接删除它。

The only purpose of the header seems to be security scanners and surveys how much market share each server has. In Apache it is not possible to completely remove the header, it can only be set to be minimal so that it just advertises "Apache". One needs to patch the binary to completely remove it or to recompile it oneself.

I think with IIS it is also not straight-forward to remove it.

梦在夏天 2024-07-26 04:49:50

统计数据.. 无论是谁,都会让你知道事情何时以及如何传播..

尝试一下谷歌,看看 3 个字母的服务器:响应.. 周围有很多人,因为他们多年前购买了很多盒子。

[这就像声称 Apache 或 IIS 传播得太快一样,就在我议员的开支上..]

Stats.. and whoever it was will give you idea when and how things are spreading..

Try the dons Google and see the 3 letter Server: response.. Plenty of those around since they purchased plenty of boxes years and years back.

[ It's like claiming that Apache or IIS was spreading too fast, right on my MP's expenses .. ]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文