Nginx Bad Request errors

Source: Internet
Author: User
Today found logs mass 400 error

The http1.1 standard specifies that the request must contain header information, and if the request header is empty then Web server returns 400 in detail and can see RFC 2316, section 14.23

In addition to the above-mentioned Telnet method may cause the empty request header, when the browser downloads the picture while clicking other links, will close the download connection, will also appear the empty request header, or the robot constructs the empty request header to access.

Remove the 400 method from the access log

0.7.12 Previous version of Nginx received an empty request, Nginx will not go to match any virtual host, directly return 400 error,

After the new version of Nginx can be used server_name _, matching the empty request header.

So if you use an older version, upgrade to 0.7.12 later versions

Add the following default virtual host server after upgrade.

Add the default server-to-configuration file, the following configuration is interpreted to prohibit the access of an unbound domain name here

server {  listen default_server;  server_name _;  return 404;  Access_log off;}

It is recommended that the above server be saved as default.conf and then include to the master profile nginx.conf.


The above describes the Nginx bad request errors, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.