/other/

Remove X-Powered-By on wildfly 10

2017-06-16 19:39:02

remove X-Powered-By:Undertow/1 header

remove filter-refs and response-headers from standalone.xml


<subsystem xmlns='"urn:jboss:domain:undertow:3.0"'>
    ...
    <host alias='"localhost"' name='"default-host"'>
        ...
        <filter-ref name='"server-header"/'>
<filter-ref name='"x-powered-by-header"/'>
</filter-ref></filter-ref></host>
    ...
    <filters>
<response-header header-name='"Server"' header-value='"WildFly/10"/' name='"server-header"'>
<response-header header-name='"X-Powered-By"' header-value='"Undertow/1"/' name='"x-powered-by-header"'>
</response-header></response-header></filters>
    ...
</subsystem>

remove X-Powered-By:JSP

extend jsp-config in standalone.xml


<subsystem xmlns='"urn:jboss:domain:undertow:3.0"'>
    ...
    <servlet-container default-encoding='"UTF8"' name='"default"'>
<jsp-config x-powered-by='"false"/'>
        ...
    </jsp-config></servlet-container>
    ...
</subsystem>

stop and start wildfly

/wildfly/bin# ./jboss-cli.sh --connect command=:shutdown
/wildfly/bin# ./standalone.sh &amp;