0

Particular requests are coming into my site formed as: www.example.com\

The trailing backslash is causing a 503 response to come from the server, which is behind an ELB, ideally I'd send these back with a 400 Bad Request response.

I've tested:

Redirect 400 ^/testurl$

And that works.

But the following:

Redirect 400 ^\\$

doesn't have any effect, probably because apache vhost is looking for the backslash after the trailing /

Does anyone have any idea how I can accurately target a request for www.example.com\ ? Or is there something about having a \ in the request that's causing another issue?

2652763
  • 101
  • 2
  • Wait, is the incoming requests' `Host` header value `www.example.com\ ` or `www.example.com`? If the first one is the case, you're `www.example.com` vhost won't ever receive and process the request – Mathias R. Jessen Feb 03 '15 at 17:04
  • Here is an example from the elb log `"GET http://www.example.com\:80/ HTTP/1.0"` – 2652763 Feb 03 '15 at 17:32
  • As you can see, the trailing `\ ` is placed before the port part, indicating that it is part of the `Host` name, not the actual request. You'll need to handle them in a catch-all vhost – Mathias R. Jessen Feb 03 '15 at 18:29
  • After further testing it turns out Apache handled the requests correctly, but the problem was Varnish. – 2652763 Feb 04 '15 at 19:17

0 Answers0