TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why do web servers still reveal their type and version in headers?

3 点作者 johnsanders超过 2 年前
Isn't that inviting bad actors to scour the web for servers with just the right vulnerability? What's to gain by revealing that?

2 条评论

LinuxBender超过 2 年前
There is no need to reveal this today. Long ago most daemons would advertise what they were and their version in the event clients might need to negotiate around specific behaviors, quirks or bugs.<p>In NGinx one can get rid of this without recompiling by adding the &quot;nginx-mod-http-headers-more&quot; module and adding to nginx.conf:<p><pre><code> more_set_headers &#x27;Server: IIS&#x2F;4.0&#x27;; # or whatever </code></pre> HAProxy and most load balancer daemons can filter out or replace the Server header. Apache requires a recompile to drop the Server header unless one puts HAProxy in front of it due to the order in how headers are processed. In HAProxy:<p><pre><code> http-response set-header Server Silly </code></pre> or<p><pre><code> http-response del-header Server </code></pre> After making changes one can scan their headers in SecurityHeaders [1] to see what has changed, or use curl:<p><pre><code> curl --head https:&#x2F;&#x2F;some.tld&#x2F; </code></pre> As to why they still display this? Showing off in crawler stats who is dominate on the internet.<p>[1] - <a href="https:&#x2F;&#x2F;securityheaders.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;securityheaders.com&#x2F;</a>
评论 #33294810 未加载
评论 #33303407 未加载
sylware超过 2 年前
Some sites may provide a default noscript&#x2F;basic (x)html web interface.