3 Replies Latest reply on Dec 2, 2008 4:28 AM by nickarls

    HTTP 400. Bad request! Sit! Stay!

    nickarls

      I have a 4.2.2.GA running with -b 0.0.0.0 and no virtual hosts.

      http://localhost (locally) works
      http://hostname (locally) works
      http://ip (locally) works
      http://ip (remotely) works
      http://hostname (remotely) works

      but

      http://<DNS entry that resolves to hostname/ip>

      fails with a blank page or HTTP 400 Bad Request

      What checks does JBoss/Tomcat do to see if there is some hostname mixup?

      Thanks in advance,
      Nik

        • 1. Re: HTTP 400. Bad request! Sit! Stay!
          nickarls

          It turns out that telnetting to the DNS name port 80 and doing a "GET /" returns the page just fine.

          Is it some conspiracy amongst all browsers to consider a response as bad if it comes from a hostname it didn't expect? And if so, what is the remedy? Some alias or virtual host in JBoss?

          Thanks in advance,
          - Nik

          • 2. Re: HTTP 400. Bad request! Sit! Stay!
            nickarls

            More specifically, dumping the reponse headers gives

            null:
             HTTP/1.1 400 No Host matches server name thehost.thedomain.com
            Transfer-Encoding:
             chunked
            Date:
             Mon, 01 Dec 2008 12:11:43 GMT
            Connection:
             close
            Server:
             Apache-Coyote/1.1
            


            ping thehost.thedomain.com does lead back to the correct host

            • 3. Re: HTTP 400. Bad request! Sit! Stay!
              nickarls

              I tried using virtual hosts and it seems to be working when used from the internal network but the above mentioned error still occurs when coming from an external network.

              Network configurations aside, how can this error anyways be related to where the request is originating from?