I'm getting the following error when attempting an upload with this module:

An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /file/ajax/field_image/und/0/form-ivFdpYUXtQLtg4JbAbBqZz4gWngr7Tz7MkhEylclYuw/x-progress-id%3A1437042354
StatusText: n/a
ResponseText: 413 Request Entity Too Large
nginx/1.0.6
ReadyState: undefined

I believe I've set everything up correctly, though I am having a little trouble / seeing slightly different things which could be the issue.

My nginx version, which is some bleeding edge release from ubuntuupdates.org has the following condition:
--add-module=/build/buildd/nginx-1.0.6/debian/modules/nginx-upload-progress

notice the lack of "-module" at the end. Could this be an issue?

I have included the upload_progress statement in my nginx.conf file, right above the site includes.

Here is my site file. I've tried the following, and also tried combining the track_uploads statement with the other location ~ \.php$ { stanza. I apologize, but this is my first foray into nginx and I might be doing things wrong.

server {
        server_name example.com;

        root /var/www/example.com/public;

        access_log /var/www/example.com/logs/access.log;
        error_log /var/www/example.com/logs/error.log;

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }

        location ~ \..*/.*\.php$ {
                return 403;
        }

        location / {
                try_files $uri @rewrite;
        }

        location @rewrite {
                rewrite ^/(.*)$ /index.php?q=$1;
        }

        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME /var/www/example.com/public$fastcgi_script_name;
                fastcgi_pass 127.0.0.1:9000;
        }
        location ~ ^/sites/.*/files/styles/ {
                try_files $uri @rewrite;
        }

        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires max;
                log_not_found off;
        }

        ## The Nginx module wants ?X-Progress-ID query parameter so
        ## that it report the progress of the upload through a GET
        ## request. But the drupal form element makes use of clean
        ## URLs in the POST.
        location ~ (.*)/x-progress-id:(\w*) {
                rewrite ^(.*)/x-progress-id:(\w*)  $1?X-Progress-ID=$2;
        }

        ## Now the above rewrite must be matched by a location that
        ## activates it and references the above defined upload
        ## tracking zone.
        location ^~ /progress {
                report_uploads uploads;
        }

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
                track_uploads uploads 60s;
        }

Comments

mshick’s picture

Status: Active » Fixed

Oops. Turns out my client_max_body_size was not set properly. I upped the limit there, then with a little jiggering thanks to this issue: http://drupal.org/node/1159400

Was able to get everything working correctly. The site file I defined above seems to do the trick in my environment.

Great module! Thanks.

perusio’s picture

You have to increase client_max_body_size. By default is 1 MB. Like this on your server or http config:

client_max_body_size 100m; # This makes it possible to upload files up to 100 MB
perusio’s picture

Assigned: Unassigned » perusio

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.