Shortened response

pupan nginx-forum at nginx.us
Tue Jul 5 16:03:40 MSD 2011


I'm having nginx + thin (rails) environment and somehow all my responses
which are larger than 74KB are truncated to that size (ie. my json
response which have up to 100KB are truncated to 74KB, same happens with
larger HTMLs).

When i point browser to thin server response looks fine. Here is my
nginx conf:

user  xxxxxx;
worker_processes  1;

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"
"$upstream_addr"';

    access_log  logs/access.log  main;

    sendfile        on;

    keepalive_timeout  65;

    upstream thin {
       	server 127.0.0.1:3000;
	server 127.0.0.1:3001;
    }

    server {
        listen       80;
        server_name  localhost;
	root /home/xxxx/Rails/yyyyy/public/;

        location / {
    		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_redirect off;

        	auth_basic            "Restricted";
        	auth_basic_user_file  htpasswd;

  		# don't page cache any POST requests
  		if ($request_method = POST) {
    			proxy_pass http://thin;
    			break;
  		}

                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://thin;
                        break;
                }
        }

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

    }
}


Best

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,211963,211963#msg-211963




More information about the nginx mailing list