Skip to content

Instantly share code, notes, and snippets.

@leapingbytes
Created July 12, 2014 11:28
Show Gist options
  • Save leapingbytes/949b34ac7bd83965233f to your computer and use it in GitHub Desktop.
Save leapingbytes/949b34ac7bd83965233f to your computer and use it in GitHub Desktop.
How to make Wildfly send "Connection: close" instead of "Connection: keep-alive"
<subsystem xmlns="urn:jboss:domain:undertow:1.1">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" always-set-keep-alive="false"/>
<https-listener name="default-s" socket-binding="https" security-realm="UndertowRealm" always-set-keep-alive="false"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<access-log prefix="access"/>
<filter-ref name="connection-close"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="connection-close" header-name="Connection" header-value="close"/>
<response-header name="server-header" header-name="Server" header-value="WildFly/8"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>
@janfabry
Copy link

Instead of just overriding the header, it might be better to disable the always-set-keep-alive attribute of Undertow.

@Manjunatha1utthungacom
Copy link

Hi janfabry.

how to set keepalive : timeout with max in wildfly 9.0.2 server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment