Rgin应用程序在Nginx和Thin,400错误请求请求标头或Cookie过大

时间:2012-03-16 02:18:42

标签: nginx

正确投放静态页面您可以访问:http://www.ec2.lankenow.info/ 单击图像,它将转到错误页面。

Nginx错误日志:

2012/03/16 01:58:41 [alert] 884#0: 768 worker_connections are not enough  

2012/03/16 01:58:41 [error] 887#0: *3900 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 23.21.141.105, server: www.ec2.lankenow.info, request: "GET /leads HTTP/1.0", upstream: "http://23.21.141.105:80/leads", host: "www.ec2.lankenow.info", referrer: "http://www.ec2.lankenow.info/"

我想我可能要设置client_header_buffer_size,但不知道要编辑的文件或文件。 任何方向如何去做都将非常感激。

编辑:这可以添加到nginx.conf的http部分,可以在/ etc / nginx /中找到 或usr / local / nginx /取决于您的安装

/ etc / nginx / sites-available /

下的配置文件
upstream vdiamond {
    server 0.0.0.0:3000;
    server 0.0.0.0:3001;
    server 0.0.0.0:3002;        
}


server {
    listen   80;
    server_name www.ec2.lankenow.info;

    access_log /home/ubuntu/vdiamond/log/access.log;
    error_log /home/ubuntu/vdiamond/log/error.log;

    root   /home/ubuntu/vdiamond/public/;
    index  index.html;

    location / {

        # Add expires header for static content
        location ~* \.(js|css|jpg|jpeg|gif|png)$ {
            if (-f $request_filename) {
                expires      max;
                break;
            }
        }

        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_read_timeout 300;
        proxy_next_upstream off;

        #proxy_redirect false;

        if (-f $request_filename/index.html) {
            rewrite (.*) $1/index.html break;
        }

        if (-f $request_filename.html) {
            rewrite (.*) $1.html break;
        }

        if (!-f $request_filename) {
            proxy_pass http://www.ec2.lankenow.info;
            break;
        }
    }
}

0 个答案:

没有答案