# Error\_page for 413 not working on remote machine, but works on localhost

**URL:** <https://www.ruby-forum.com/t/error-page-for-413-not-working-on-remote-machine-but-works-on-localhost/208439>\
**Category:** NGINX\
**Created:** [June 18, 2011, 7:14am UTC](https://www.ruby-forum.com/t/error-page-for-413-not-working-on-remote-machine-but-works-on-localhost/208439 "2011-06-18T07:14:42Z")\
**Posts on this page:** 4\
**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:** [June 18, 2011, 7:14am UTC](https://www.ruby-forum.com/t/error-page-for-413-not-working-on-remote-machine-but-works-on-localhost/208439/1 "2011-06-18T07:14:42Z")

</div>

Hi all,

I am trying to setup an error\_page for 413 (Too large uploads). It  
works perfectly fine on localhost, where it doesn’t work on my remote  
staging machine.

There is no change in the configuration file (except for the hostname  
setting). When I try to upload a file larger than the limit (which is  
the default 1MB) in case of the remote machine, the request gets  
aborted, i.e. Firefox throws up the “Connection was reset” error page.  
In the case of localhost, however, I get the appropriate error file.

The error file permissions are proper. I see the 413 log line in  
access.log and the corresponding entry in error.log in both setups. It  
is the exact same build (0.8.52) on both machines.

Any pointers to troubleshoot this?

Would any other data from my side be useful to better  
understand/diagnose the issue here?

–  
Regards,  
Srirang G Doddihal  
Brahmana.

The LIGHT shows the way.  
The WISE see it.  
The BRAVE walk it.  
The PERSISTENT endure and complete it.

I want to do it all ALONE.

---

<div class="post-metadata">

**Author:** ![Srirang\_Doddihal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@Srirang\_Doddihal](https://www.ruby-forum.com/u/Srirang_Doddihal)\
**Post date:** [June 18, 2011, 2:12pm UTC](https://www.ruby-forum.com/t/error-page-for-413-not-working-on-remote-machine-but-works-on-localhost/208439/2 "2011-06-18T14:12:32Z")

</div>

Hi all,

I am trying to setup an error\_page for 413 (Too large uploads). It  
works perfectly fine on localhost, where it doesn’t work on my remote  
staging machine.

There is no change in the configuration file (except for the hostname  
setting). When I try to upload a file larger than the limit (which is  
the default 1MB) in case of the remote machine, the request gets  
aborted, i.e. Firefox throws up the “Connection was reset” error page.  
In the case of localhost, however, I get the appropriate error file.

The error file permissions are proper. I see the 413 log line in  
access.log and the corresponding entry in error.log in both setups. It  
is the exact same build (0.8.52) on both machines.

Any pointers to troubleshoot this?

Would any other data from my side be useful to better  
understand/diagnose the issue here?

–  
Regards,  
Srirang G Doddihal  
Brahmana.

The LIGHT shows the way.  
The WISE see it.  
The BRAVE walk it.  
The PERSISTENT endure and complete it.

I want to do it all ALONE.

---

<div class="post-metadata">

**Author:** ![Srirang\_Doddihal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@Srirang\_Doddihal](https://www.ruby-forum.com/u/Srirang_Doddihal)\
**Post date:** [June 18, 2011, 2:27pm UTC](https://www.ruby-forum.com/t/error-page-for-413-not-working-on-remote-machine-but-works-on-localhost/208439/3 "2011-06-18T14:27:22Z")

</div>

On 18.06.2011 15:12, Srirang Doddihal wrote:

> The error file permissions are proper. I see the 413 log line in  
> access.log and the corresponding entry in error.log in both setups. It  
> is the exact same build (0.8.52) on both machines.
> 
> Any pointers to troubleshoot this?

looks like this is browser issue, not nginx one.

(russian language) explanation: [Почему невозможно корректно ограничить размер закачиваемого файла](http://sysoev.ru/web/upload.html)

try translate it to english via google translate.

–  
Best regards,  
Gena

---

<div class="post-metadata">

**Author:** ![Srirang\_Doddihal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@Srirang\_Doddihal](https://www.ruby-forum.com/u/Srirang_Doddihal)\
**Post date:** [June 22, 2011, 7:44am UTC](https://www.ruby-forum.com/t/error-page-for-413-not-working-on-remote-machine-but-works-on-localhost/208439/4 "2011-06-22T07:44:37Z")

</div>

mr srirang,

```
    you are using nginx upload module right. 413 will be thrown when

```

the request entity too large .set the field like this

```
    upload_max_output_body_len 0;

   0 means there will be no restriction for the file size u r

```

uploading .check in ur remote machine config .if u did nt specify the  
above .the default will be 100kb. and another thing there is no file  
limit .u can change to whatever the size u want to upload.

if u still get that connection was reset

try like this

comment the access\_log path in your config file

then upload

may be because access permission in writing log file.

Posted at Nginx Forum:

> **[Re: error\_page for 413 not working on remote machine, but works on localhost](https://forum.nginx.org/read.php?2,207989,208920#msg-208920)**
>
> Hi all, I am trying to setup an error\_page for 413 (Too large uploads). It works perfectly fine on localhost, where it doesn't work on my remote staging machine. There is no change in the configuration file (except for the hostname setting). When I...
