免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 11612 | 回复: 11
打印 上一主题 下一主题

nginx 400错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-14 16:30 |只看该作者 |倒序浏览
用nginx部署了一个软件下载站,可是在log日志里经常出现400的错误
错误日志如下,查了网上资料说是修改,下面两个选项可以解决,但是我添加以后,400错误仍然出现。有哪位知道如何解决吗
client_header_buffer_size 128k;
large_client_header_buffers 8 128k;
117.136.13.3 - - [14/Aug/2009:16:13:08 +0800] - 400 0 - - - -
117.136.22.137 - - [14/Aug/2009:16:13:04 +0800] - 400 0 - - - -

论坛徽章:
0
2 [报告]
发表于 2009-08-14 16:55 |只看该作者
换nginx 0.8.8试一试

论坛徽章:
0
3 [报告]
发表于 2009-08-14 17:03 |只看该作者
换成nginx-0.8.8的版本了,没有改善还是出现400错误,apache就没有问题,奇怪了。我的配置如下

user  apache apache;
worker_processes     8;

error_log  logs/error.log  notice;
pid        logs/nginx.pid;

worker_rlimit_nofile 8192;

events
{
    use epoll;
    worker_connections  8192;
}
http
{
    include       mime.types;
    default_type  application/octet-stream;

    sendfile      on;
    tcp_nopush    on;

    keepalive_timeout  65;
    tcp_nodelay        on;
client_header_buffer_size 512k;
large_client_header_buffers 4 512k;
    server
    {
        listen          80;
        server_name     localhost;
        charset         utf-8;
        index index.jsp index.wml index.html index.htm;
        error_page 500 404 403 /err404.wml;

        include rewrite_s.conf;

        location /
        {
                root /var/www/html;
                if (-d $request_filename){
                        rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
                }

        }

        location ~ (/webdav)|(\.jsp)|(\.do)$
        {
                include       proxy.conf;
                proxy_pass http://127.0.0.1:8087;
        }

        location /Status
        {
                stub_status     on;
                access_log      off;
                allow all;
        }

        log_format  main '$remote_addr - $remote_user [$time_local] $request '
                '$status $body_bytes_sent $http_referer $http_user_agent '
                '$http_x_up_calling_line_id $http_x_forwarded_for';
        access_log  /var/log/accesslog/nginx/localhost_access.log  main;

    }
}

论坛徽章:
0
4 [报告]
发表于 2009-08-15 12:01 |只看该作者
worker_processes    改成 1 试一试。你几个cpu就改成几

论坛徽章:
0
5 [报告]
发表于 2009-08-15 12:02 |只看该作者
你的下载都是大文件的话,可能需要把keepalive_timeout  65;改大

并发量多少?

论坛徽章:
0
6 [报告]
发表于 2009-08-17 18:18 |只看该作者
原帖由 hongbool 于 2009-8-15 12:02 发表
你的下载都是大文件的话,可能需要把keepalive_timeout  65;改大

并发量多少?

keepalive_timeout  65;修改成120了,我的并发是300左右。
还是不行,还是出400的错误

论坛徽章:
0
7 [报告]
发表于 2009-08-18 11:04 |只看该作者
太郁闷了,有人碰到过这个问题吗。

论坛徽章:
0
8 [报告]
发表于 2009-08-25 21:18 |只看该作者

回复 #1 西山晴雪 的帖子

php的代码要调整的

论坛徽章:
0
9 [报告]
发表于 2009-10-14 15:28 |只看该作者
我也碰到这个问题,400错误很多,我的服务器是做下载用的,都没用到php,郁闷, 一直没有解决掉

论坛徽章:
5
寅虎
日期:2015-01-20 09:16:52亥猪
日期:2015-01-21 14:43:44IT运维版块每日发帖之星
日期:2015-12-17 06:20:00每日论坛发贴之星
日期:2015-12-17 06:20:00每周论坛发贴之星
日期:2015-12-20 22:22:00
10 [报告]
发表于 2009-10-14 16:08 |只看该作者
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP