Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bad Request, Your browser sent a request that this server could not understand

Tags:

request

There are two application servers and a switch. When i access application by using application server ip it works fine. However if i use switch ip in my url Bad request error throws up only for firefox and chrome for a few links only.

like image 471
Farooq Avatar asked Apr 25 '12 05:04

Farooq


People also ask

How do you fix bad request your browser sent a request that this server could not understand on Iphone?

Chosen solution "Clear the cache: Options/Preferences -> Privacy & Security -> Cached Web Content: "Clear Now"

Why does my browser say bad request?

Conclusion. The HTTP status 400 – bad request indicates that the request sent to the server is invalid or corrupted. Just like other 4xx status codes, a 400 bad request is a client-side issue. It can be caused by malformed request syntax, invalid request message framing, or deceptive request routing.


3 Answers

Here is a detailed explanation & solution for this problem from ibm.

Problem(Abstract)

Request to HTTP Server fails with Response code 400.

Symptom

Response from the browser could be shown like this:

Bad Request Your browser sent a request that this server could not understand. Size of a request header field exceeds server limit.

HTTP Server Error.log shows the following message: "request failed: error reading the headers"

Cause

This is normally caused by having a very large Cookie, so a request header field exceeded the limit set for Web Server.

Diagnosing the problem

To assist with diagnose of the problem you can add the following to the LogFormat directive in the httpd.conf: error-note: %{error-notes}n

Resolving the problem

For server side: Increase the value for the directive LimitRequestFieldSize in the httpd.conf: LimitRequestFieldSize 12288 or 16384 For How to set the LimitRequestFieldSize, check Increase the value of LimitRequestFieldSize in Apache

For client side: Clear the cache of your web browser should be fine.

like image 173
David Avatar answered Sep 23 '22 08:09

David


If you use Apache httpd web server in version above 2.2.15-60, then it could be also because of underscore _ in hostname.

https://ma.ttias.be/apache-httpd-2-2-15-60-underscores-hostnames-now-blocked/

like image 36
Bobík Avatar answered Sep 24 '22 08:09

Bobík


I just deleted my stored cookies, site data, and cache from my browser... It worked. I'm using firefox...

like image 45
Allegue Avatar answered Sep 23 '22 08:09

Allegue