# Shortened response

**URL:** <https://www.ruby-forum.com/t/shortened-response/209086>\
**Category:** NGINX\
**Created:** [July 5, 2011, 2:04pm UTC](https://www.ruby-forum.com/t/shortened-response/209086 "2011-07-05T14:04:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [July 5, 2011, 2:04pm UTC](https://www.ruby-forum.com/t/shortened-response/209086/1 "2011-07-05T14:04:27Z")

</div>

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:

> **[Shortened response](https://forum.nginx.org/read.php?2,211963,211963#msg-211963)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![pupan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e9c0ed/32.png) [@pupan](https://www.ruby-forum.com/u/pupan)\
**Post date:** [July 5, 2011, 2:23pm UTC](https://www.ruby-forum.com/t/shortened-response/209086/2 "2011-07-05T14:23:01Z")

</div>

Hello!

On Tue, Jul 05, 2011 at 08:03:40AM -0400, pupan wrote:

> 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).

What’s in error log? Best guest is that nginx doesn’t have write  
access to proxy\_temp\_path, it should complain there.

Maxim D.

---

<div class="post-metadata">

**Author:** ![pupan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e9c0ed/32.png) [@pupan](https://www.ruby-forum.com/u/pupan)\
**Post date:** [July 5, 2011, 3:00pm UTC](https://www.ruby-forum.com/t/shortened-response/209086/3 "2011-07-05T15:00:08Z")

</div>

It worked like a charm, but it’s little bit strange that there is no  
mention of perm. denied in error log (last entries are from two days  
ago, and also i just turned off rails servers and upstream error is  
logged correctly in error.log).

Whatever, tx again.

Posted at Nginx Forum:

> **[Re: Shortened response](https://forum.nginx.org/read.php?2,211963,211968#msg-211968)**
>
> 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...
