Rails Application on Nginx and Thin, 400 Bad Request Request Header or Cookie Too Large

The static page is serving correctly, you can visit: http://www.ec2.lankenow.info/ click on the image and it will take you to the error page.

Nginx error log:

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:, server: www.ec2.lankenow.info, request: "GET /leads HTTP/1.0", upstream: "", host: "www.ec2.lankenow.info", referrer: "http://www.ec2.lankenow.info/"


I think I might have to set client_header_buffer_size, but don't know how or which file to edit. Any direction how to do this would be much appreciated.

EDIT: This can be added to the nginx.conf http section which can be found in the / etc / nginx / or usr / local / nginx / file depending on your installation

Configuration file in / etc / nginx / sites -available /

upstream vdiamond {

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;

        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;



source to share

All Articles