Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Another newbie-9.x-user question


On Wed, Feb 1, 2017 at 10:21 AM, John English <john.foreign@xxxxxxxxx> wrote:
> Here's what I see in my request logs, which shows the problem more clearly.
> I have a 404 page in my webapp, and I define a list of virtual hosts. Here's
> what I see in the request log:
> Request to (which is listed as a valid virtual host):
> - - [25/Jan/2017:16:48:51 +0000] "GET /foo HTTP/1.1" 404 666
> Same request to (which isn't):
> - - [25/Jan/2017:16:53:32 +0000] "GET /foo HTTP/1.1" 404 0
> So the request to the valid virtual host name gives me 666 bytes (the 404
> page specified by my webapp), whereas the same request to an invalid
> hostname gives zero bytes.
> (I've just done some more experiments, and moved my webapp from a context
> path of "/" to "/x" -- I discovered that the same thing happens for *all*
> 404s not handled by my webapp.)
> Any ideas what I need to do to configure the generic 404, as opposed to my
> webapp's 404?

Do you have a webapp that answers to the virtual host (or
that has no virtual hosts and therefore answers to them all) ?

If not, because you always use specific virtual hosts for your
webapps, then you can have a super-simple webapp deployed at "/" with
no virtual hosts whose only page displays a 404 message.

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.

Back to the top