# Upload Progress

**URL:** <https://www.ruby-forum.com/t/upload-progress/225083>\
**Category:** NGINX\
**Created:** [December 11, 2012, 11:19pm UTC](https://www.ruby-forum.com/t/upload-progress/225083 "2012-12-11T23:19:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [December 11, 2012, 11:19pm UTC](https://www.ruby-forum.com/t/upload-progress/225083/1 "2012-12-11T23:19:02Z")

</div>

Hello,

I recently installed [NGINX Upload Progress Module | NGINX](http://wiki.nginx.org/HttpUploadProgressModule)  
with nginx 1.2.6.

On the client side I have a request coming every second to check on  
the upload status. As I watch the access.log I can see all of the  
status check requests before the actual file post shows up in the  
access log.

I am wondering if that is normal or should I see the file post show up  
in the access log then the status check requests after that?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 12, 2012, 9:36am UTC](https://www.ruby-forum.com/t/upload-progress/225083/2 "2012-12-12T09:36:32Z")

</div>

Hello!

On Tue, Dec 11, 2012 at 04:18:01PM -0600, Matt M wrote:

> I am wondering if that is normal or should I see the file post show up  
> in the access log then the status check requests after that?

It’s normal. Logging happens after a request processing is  
complete, after sending the response, and hence status check  
requests are logged before the file post.

–  
Maxim D.

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 13, 2012, 3:56am UTC](https://www.ruby-forum.com/t/upload-progress/225083/3 "2012-12-13T03:56:52Z")

</div>

Hi!

If you compile your nginx with debug - enable debug logging, restart  
nginx  
and you will see messages from upload module, it is very helpful.

Also read this note  
[NGINX Upload Progress Module | NGINX](http://wiki.nginx.org/HttpUploadProgressModule#track_uploads) - “The POST  
\*  
must\* have a query parameter called \*X-Progress-ID”… \*If the POST has  
no  
such information, the upload will not be tracked…

2012/12/12 Matt M [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 13, 2012, 3:27pm UTC](https://www.ruby-forum.com/t/upload-progress/225083/4 "2012-12-13T15:27:23Z")

</div>

Hi! Thanks for the response.

On Wed, Dec 12, 2012 at 8:56 PM, Sokolov E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi!
> 
> If you compile your nginx with debug - enable debug logging, restart nginx  
> and you will see messages from upload module, it is very helpful.
> 
> Also read this note  
> [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpUploadProgressModule#track_uploads) - “The POST  
> must have a query parameter called X-Progress-ID”… If the POST has no such  
> information, the upload will not be tracked…

I have double checked and I can see the post variable X-Progress-ID  
coming with the upload but the status just stays at starting. My  
nginx.conf looks like this:  
worker\_processes 1;

events {  
worker\_connections 1024;  
}

http {  
#error\_log /usr/local/nginx/logs/error.log debug;  
include mime.types;  
default\_type application/octet-stream;

```
sendfile on;

tcp_nopush on;
tcp_nodelay off;

gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript

```

text/xml application/xml application/xml+rss text/javascript;

```
upstream modperl {
    ip_hash;

    server 127.0.0.1:8080;
}
client_body_timeout 10;
client_header_timeout 10;

```

client\_max\_body\_size 3M;  
keepalive\_timeout 10;  
send\_timeout 10;  
limit\_conn\_zone $binary\_remote\_addr zone=limit\_per\_ip:16m;

```
# reserve 1MB under the name 'proxied' to track uploads
upload_progress proxied 1m;

```

upload\_progress\_json\_output;

```
# HTTP Server
server {
    listen 80;
    server_name _;

    root /var/www/$host/;

```

limit\_conn limit\_per\_ip 5;  
proxy\_buffering off;

## Only allow GET and HEAD request methods

if ($request\_method !~ ^(GET|HEAD|POST)$ ) {  
return 444;  
}

```
    # Serve static files directly
    location ~*

```

^(?!/(internal\_documents)).+.(jpg|jpeg|gif|css|js|ico|html|swf|png|pdf|xls|xlsx|doc|docx)$  
{  
access\_log off;  
expires 30d;  
}

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

```

location / {

# needed to forward user’s IP address to rails

proxy\_set\_header X-Real-IP $remote\_addr;

# needed for HTTPS

proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header Host $http\_host;  
proxy\_redirect off;  
proxy\_max\_temp\_file\_size 0;  
proxy\_read\_timeout 600;

# If the file exists as a static file serve it directly without

# running all the other rewite tests on it

if (-f $request\_filename) {  
break;  
}

proxy\_pass [http://modperl](http://modperl);

# track uploads in the ‘proxied’ zone

```
    # remember connections for 30s after they finished
    track_uploads proxied 30s;

```

}  
location ^~ /progress {  
# report uploads tracked in the ‘proxied’ zone  
report\_uploads proxied;  
}  
}

```
# HTTPS server - Without SSL Certificate
server {
    listen 442;
    server_name _;

```

limit\_conn limit\_per\_ip 5;  
proxy\_buffering off;

## Only allow GET and HEAD request methods

if ($request\_method !~ ^(GET|HEAD|POST)$ ) {  
return 444;  
}  
server\_name\_in\_redirect off;

```
    ssl off;

    root /var/www/$host/;

    # serve static files directly
    location ~*

```

^(?!/(internal\_documents)).+.(jpg|jpeg|gif|css|js|ico|html|swf|png|pdf|xls|xlsx|doc|docx)$  
{  
access\_log off;  
expires 30d;  
break;  
}

location / {

# needed to forward user’s IP address to rails

proxy\_set\_header X-Real-IP $remote\_addr;

# needed for HTTPS

proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header Host $http\_host;  
proxy\_redirect off;  
proxy\_max\_temp\_file\_size 0;  
proxy\_read\_timeout 600;

# If the file exists as a static file serve it directly without

# running all the other rewite tests on it

if (-f $request\_filename) {  
break;  
}

proxy\_pass [http://modperl](http://modperl);

# track uploads in the ‘proxied’ zone

```
    # remember connections for 30s after they finished
    #track_uploads proxied 30s;

```

}  
location ^~ /progress {  
# report uploads tracked in the ‘proxied’ zone  
report\_uploads proxied;  
}

```
}

```

}

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 14, 2012, 9:15am UTC](https://www.ruby-forum.com/t/upload-progress/225083/5 "2012-12-14T09:15:15Z")

</div>

> I can see the post variable X-Progress-ID coming with the upload

1. It must be not a “post variable” - it must be query variable.

For example:

\<input type="file" ...
1. Did you try enable debug? What you have in logs related to  
uploadprogress module?

2012/12/13 Matt M [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 12, 2012, 1:10pm UTC](https://www.ruby-forum.com/t/upload-progress/225083/6 "2012-12-12T13:10:29Z")

</div>

Thanks for the response.

On Wed, Dec 12, 2012 at 2:36 AM, Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > the upload status. As I watch the access.log I can see all of the  
> > status check requests before the actual file post shows up in the  
> > access log.
> > 
> > I am wondering if that is normal or should I see the file post show up  
> > in the access log then the status check requests after that?
> 
> It’s normal. Logging happens after a request processing is  
> complete, after sending the response, and hence status check  
> requests are logged before the file post.

I am curious. The status never gets past “starting” in the progress  
response. Where should I look to try to debug this? I am not very good  
at system admin.
