在响应标头中更改Tomcat服务器名称,这可能吗? [英] Changing Tomcat server name in response header, is that possible?

查看:87
本文介绍了在响应标头中更改Tomcat服务器名称,这可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发出来自浏览器的http请求时,通常服务器容器将在标头中发送它是哪个服务器。

When a http request from a browser is made, typically the server container will send along in the header what server it was.

对于tomcat,它发送

For tomcat it sends

   Server:Apache-Coyote/1.1

我知道我可以为每个请求覆盖此标头,但是对于websocket和可能还有其他连接。

I know I can overwrite this header, for each request, but there is also the case for websockets and potentially other connections.

那么,有什么方法可以在tomcat配置级别进行更改吗?

So, is there a way to change this at the tomcat configuration level?

推荐答案

我在发布问题后才发现:

I just found this after posting the question:

添加这是tomcat配置文件夹中的server.xml。

Add this to server.xml in tomcat config folder.

<Connector port="8080" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="8443"
                   server="MYSERVER"
                />

似乎可以正常工作。

重新启动服务器

这篇关于在响应标头中更改Tomcat服务器名称,这可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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