1 Reply Latest reply on Aug 16, 2011 9:57 AM by mortsa

    How to configure custom HTTP response headers in AS7?

    mortsa

      The default value for the HTTP header "Server" is "Apache-Coyote/1.1", and I want this HTTP header to show the server hostname. This makes it easier to identify the Web Server when troubleshooting, given that we are using Varnish as front end HTTP cache servers with multiple JBoss AS backends.

       

      In JBoss AS 6.0.0 I configured the HTTP response header "Server" to show the server hostname, configuring the HTTP/1.1 Connector on port 8080/tcp in the file server.xml.

       

      How can I achieve the same result by modifying the server configuration (standalone.xml) in JBoss AS 7.0.0?

       

      I do not want to depend on code written in the application deployed on the JBoss AS 7.0.0 server, to achieve the same result.

       

       

      Example JBoss AS 6.0.0:

       

            <!-- HTTP/1.1 Connector on port 8080 -->

            <Connector protocol="HTTP/1.1"

                       port="8080"

                       address="${jboss.bind.address}"

                       connectionTimeout="5000"

                       redirectPort="8443"

                       URIEncoding="UTF-8"

                       useBodyEncodingForURI="true"

                       maxThreads="250"

                       minSpareThreads="25"

                       maxSpareThreads="75"

                       maxHttpHeaderSize="8192"                 

                       emptySessionPath="true"

                       acceptCount="100"

                       disableUploadTimeout="true"

                       server="${jboss.host.name}"

                       compression="on"

                       compressionMinSize="2048"

                       noCompressionUserAgents="gozilla, traviata"

                       compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"

                       />

        • 1. Re: How to configure custom HTTP response headers in AS7?
          mortsa

          Example JBoss AS 6.0.0 HTTP Connector configuration:

                <!-- HTTP/1.1 Connector on port 8080 -->

                <Connector protocol="HTTP/1.1"

                           port="8080"

                           address="${jboss.bind.address}"

                           connectionTimeout="5000"

                           redirectPort="8443"

                           URIEncoding="UTF-8"

                           useBodyEncodingForURI="true"

                           maxThreads="250"

                           minSpareThreads="25"

                           maxSpareThreads="75"

                           maxHttpHeaderSize="8192"                 

                           emptySessionPath="true"

                           acceptCount="100"

                           disableUploadTimeout="true"

                           server="${jboss.host.name}"

                           compression="on"

                           compressionMinSize="2048"

                           noCompressionUserAgents="gozilla, traviata"

                           compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css"

                           />