Upload Progress

Hello,

I recently installed NGINX Upload Progress Module | NGINX
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?

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.

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 - “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 [email protected]

Hi! Thanks for the response.

On Wed, Dec 12, 2012 at 8:56 PM, Sokolov E. [email protected]
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
NGINX Upload Progress Module | NGINX - “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;

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;

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;
}

}

}

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 [email protected]

Thanks for the response.

On Wed, Dec 12, 2012 at 2:36 AM, Maxim D. [email protected]
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.