如何修复Nginx在任何标头测试工具上抛出400个错误的请求标头? [英] How to fix nginx throws 400 bad request headers on any header testing tools?

查看:66
本文介绍了如何修复Nginx在任何标头测试工具上抛出400个错误的请求标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用nginx的网站,以及带有标头测试工具(例如)的测试网站. http://www.webconfs.com/http-header-check.php 但是每次它说下面的400个错误请求都是来自该工具的输出.尽管我的所有页面在浏览器中都可以正常加载,当我在chrome控制台中看到该页面时,它会显示状态码200OK.

I have my site which is using nginx, and testing site with header testing tools e.g. http://www.webconfs.com/http-header-check.php but every time it says 400 bad request below is the out put from the tool. Though all my pages load perfectly fine in browser and when I see in chrome console it says status code 200OK.

HTTP/1.1 400 Bad Request => 
Server => nginx
Date => Fri, 07 Sep 2012 09:40:09 GMT
Content-Type => text/html
Content-Length => 166
Connection => close

我真的不明白我的服务器配置有什么问题吗?

I really don't understand what is the problem with my server config?

进行一些谷歌搜索建议使用来增加缓冲区的大小,我将其增加为以下内容:

A bit of googling suggests to increase the buffer size using, and I increased it to following:

large_client_header_buffers 4 16k;

相同的结果仍然存在.

The same results persist.

有人可以指引我正确的方向吗?

Can some one guide me to the right direction?

推荐答案

如Maxim Dounin在

As stated by Maxim Dounin in the comments above:

当nginx返回400(错误请求)时,它将原因记录为错误 日志,处于信息"级别.因此,一种明显的方式可以找出正在发生的事情 是配置 错误日志 在信息"级别记录消息,并在出现以下情况时查看错误日志 测试.

When nginx returns 400 (Bad Request) it will log the reason into error log, at "info" level. Hence an obvious way to find out what's going on is to configure error_log to log messages at "info" level and take a look into error log when testing.

这篇关于如何修复Nginx在任何标头测试工具上抛出400个错误的请求标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆