免费注册 查看新帖 |

Chinaunix

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

[Web] nginx问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-03 17:39 |只看该作者 |倒序浏览
2008/09/03 08:10:28 [notice] 4197#0: using the "epoll" event method
2008/09/03 08:10:28 [notice] 4197#0: nginx/0.6.31
2008/09/03 08:10:28 [notice] 4197#0: built by gcc 3.4.6 20060404 (Red Hat 3.4.6-3)
2008/09/03 08:10:28 [notice] 4197#0: OS: Linux 2.6.9-42.EL
2008/09/03 08:10:28 [notice] 4197#0: sysctl(KERN_RTSIGMAX): 0
2008/09/03 08:10:28 [notice] 4197#0: getrlimit(RLIMIT_NOFILE): 65535:65535
2008/09/03 08:10:28 [notice] 4198#0: start worker processes
2008/09/03 08:10:28 [notice] 4198#0: start worker process 4199
2008/09/03 08:10:32 [alert] 4199#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:80
2008/09/03 08:10:32 [error] 4199#0: *1021 upstream prematurely closed connection while reading response header from upstream, client: 10.10.10.10, server: 10.10.10.10, request: "GET / HTTP/1.0", upstream: "http://10.10.10.10:80/", host: "test.com"
2008/09/03 08:10:38 [alert] 4199#0: 1024 worker_connections is not enough while accepting new connection on 0.0.0.0:80
2008/09/03 08:10:38 [error] 4199#0: *2042 upstream prematurely closed connection while reading response header from upstream, client: 10.10.10.10, server: 10.10.10.10, request: "GET / HTTP/1.0", upstream: "http://10.10.10.10:80/", host: "test.com"



我的nginx现在老报这个错误,问下是什么问题?



[root@web1 conf]# cat nginx.conf
user  nobody nobody;
worker_processes  1;

error_log  logs/error.log  notice;

pid        logs/nginx.pid;

worker_rlimit_nofile 51200;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] $request '
                      '"$status" $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

#    client_header_buffer_size    1k;
#    large_client_header_buffers  4 4k;


    sendfile        on;

    keepalive_timeout  65;

    gzip  on;
    gzip_min_length  1100;
   gzip_buffers     4 8k;
    gzip_types       text/plain;

    upstream tomcats {
         server 10.10.10.10:801 weight=10;
    }



    server {
        listen       80;
        server_name  10.10.10.10 web1.com;

        charset gb2312,utf-8;

        access_log  logs//web1.com.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
            expires 24h;
        }
      




       location /NginxStatus {
                        stub_status             on;
                        access_log              off;
                }


           location / {
                        proxy_pass      http://test.com;

                       proxy_redirect          off;
                    proxy_set_header        Host $host;
                    proxy_set_header        X-Real-IP $remote_addr;
                     
              }

        error_page  404              /404.html;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
}
}



10.10.10.10:801  是一个 TOMCAT   我打算弄3个上去,但是现在一个反向代理都不好用。

[ 本帖最后由 sam.liu 于 2008-9-3 17:42 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-11-20 15:30 |只看该作者
你看看你的ulimit -a 是多少?会不会是系统的最大文件打开数不够?

论坛徽章:
0
3 [报告]
发表于 2008-11-20 15:35 |只看该作者
配置错了吧
也许应该是 proxy_pass      http://tomcats;

你的nginx自己监听在80,又proxy到自己

[ 本帖最后由 minuteman 于 2008-11-20 15:37 编辑 ]

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:53:172015亚冠之水原三星
日期:2015-06-02 16:34:202015年亚冠纪念徽章
日期:2015-10-19 18:13:37程序设计版块每日发帖之星
日期:2015-11-08 06:20:00
4 [报告]
发表于 2008-11-20 15:40 |只看该作者
原帖由 minuteman 于 2008-11-20 15:35 发表
配置错了吧
也许应该是 proxy_pass      http://tomcats;

你的nginx自己监听在80,又proxy到自己


那就Loop了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP