【问题标题】:Disable X-Powered-By in JBOSS AS 7.1.1 Final在 JBOSS AS 7.1.1 Final 中禁用 X-Powered-By
【发布时间】:2015-01-13 11:49:42
【问题描述】:

我想从 Jboss AS 7.1.1 final 的响应头中删除 Server Apache-Coyote/1.1 和 X-Powered-By JSP/2.2。我尝试了很多,但找不到任何东西。

我尝试的是

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
            <configuration>
                <static-resources listings="true"/>
                <jsp-configuration development="true" x-powered-by="false" display-source-fragment="false"/>
            </configuration>
            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
            <virtual-server name="default-host" enable-welcome-root="false">
                <alias name="localhost"/>
                <alias name="example.com"/>
            </virtual-server>
        </subsystem>

但这不起作用,仍然存在相同的响应标头。

请帮帮我。

【问题讨论】:

    标签: apache jboss7.x


    【解决方案1】:

    要修改服务器标头,您可以使用系统属性:

    org.apache.coyote.http11.Http11Protocol.SERVER
    

    例如:

    <system-properties>
         <property name="org.apache.coyote.http11.Http11Protocol.SERVER" value="myserver"/>
    </system-properties>
    

    关于 X-Powered-By 标头在 7.1.1 中存在一个已知问题,即服务器未正确处理 jsp-configuration 元素,因此未应用任何配置的设置。见jsp configuration is ignored

    在 7.1.2 版本中已修复,您可以下载并编译此版本,甚至升级到 WildFly 8.x 更好

    【讨论】:

      猜你喜欢
      • 2013-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多