# NginX and Magento very strange problem (?!)

**URL:** <https://www.ruby-forum.com/t/nginx-and-magento-very-strange-problem/227078>\
**Category:** NGINX\
**Created:** [March 3, 2013, 4:30pm UTC](https://www.ruby-forum.com/t/nginx-and-magento-very-strange-problem/227078 "2013-03-03T16:30:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![omolinete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/59ef9b/32.png) [@omolinete](https://www.ruby-forum.com/u/omolinete)\
**Post date:** [March 3, 2013, 4:30pm UTC](https://www.ruby-forum.com/t/nginx-and-magento-very-strange-problem/227078/1 "2013-03-03T16:30:58Z")

</div>

Hello All,

This is my first post on the forum, so thank you very much in advance  
for  
your attention on my topic. Hope anyone could help me 🙂

The problem we are getting with NginX and Magento, is relating to the  
download process of files such as PDF, which are in this case invoices.

Magento seems to work flawlessly under NginX, except when we try to view  
from the server any PDF file through the Magento backend, or when we try  
to  
save the same file on our local disk.

The tricky point is that we don’t get any problem when we try to  
download a  
previously uploaded PDF file to the server using the “scp” command, and  
accessing to this file using the direct URL.

The problem appears when we try to download the PDF file from the  
Magento’s  
backend; NginX contact our browser but does not start the  
transfer/download  
after you perform a restart of the NginX’s service.

I have recorded a little video of 3:27 minutes from my desktop, where  
you  
will see by yourself what is the issue we have with NginX. Here is the  
URL:  
[http://www.misspepa.com/capturedmovie.ogv](http://www.misspepa.com/capturedmovie.ogv) . Please, note that there’s no  
audio for the video.

We are really convinced that the problem is at the NginX side and not on  
Magento side, because as you will see on the video, when we restart the  
NginX service the transfer which still says “Starting” (when it is  
really  
frozen) is rapidly accomplished with success.

If I do not restart the NginX service, the download transfer process of  
such  
files will become stalled for a indefinitely period of time with no  
success…

… And last but not last, the logs of NginX didn’t report any error.  
So,  
for that reason I decided to post my issue to the forum, in order to get  
some help on this subject.

Thank you very much in advance!!  
MOLI

Posted at Nginx Forum:

> **[NginX and Magento very strange problem (?!)](https://forum.nginx.org/read.php?2,236869,236869#msg-236869)**
>
> Hello All, This is my first post on the forum, so thank you very much in advance for your attention on my topic. Hope anyone could help me :) The problem we are getting with NginX and Magento, is relating to the download process of files such as PDF,...

---

<div class="post-metadata">

**Author:** ![omolinete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/59ef9b/32.png) [@omolinete](https://www.ruby-forum.com/u/omolinete)\
**Post date:** [March 4, 2013, 12:45pm UTC](https://www.ruby-forum.com/t/nginx-and-magento-very-strange-problem/227078/2 "2013-03-04T12:45:13Z")

</div>

Hello!

On Sun, Mar 03, 2013 at 10:30:17AM -0500, omolinete wrote:

> save the same file on our local disk.  
> will see by yourself what is the issue we have with NginX. Here is the URL:  
> success…
> 
> … And last but not last, the logs of NginX didn’t report any error. So,  
> for that reason I decided to post my issue to the forum, in order to get  
> some help on this subject.

From the symptoms described/shown I would suppose Content-Length  
is reported incorrectly by a backend, which makes browser to  
assume there will be more data and to wait for it. Restart of the  
nginx forces close of the connection and convinces browser there  
is nothing to wait for.

It’s just a guess though, you should use debug log and/or tcpdump  
to analize what actually goes on. See here for some debugging  
hints:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![omolinete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/59ef9b/32.png) [@omolinete](https://www.ruby-forum.com/u/omolinete)\
**Post date:** [March 14, 2013, 2:46pm UTC](https://www.ruby-forum.com/t/nginx-and-magento-very-strange-problem/227078/3 "2013-03-14T14:46:42Z")

</div>

Our magento experts resolve complicated issues on ecommerce websites by  
building custom extensions and modules, to meet your custom requirements  
or  
for a no obligation free quote get in touch with us.

Posted at Nginx Forum:

> **[Nginx Forum :: Nginx Mailing List - English](https://forum.nginx.org/read.php?2,236869,237353#msg-237353)**
>
> A portal to and from the mailing list.
