summaryrefslogtreecommitdiff
path: root/etc/nginx/apps/drupal/drupal_upload_progress.conf
blob: 843fb06c0ddc84141fe39535175c3d2ac4d1934c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- mode: nginx; mode: flyspell-prog;  ispell-current-dictionary: american -*-

### Drupal 7 configuration for the Nginx Upload Progress module:
### https://github.com/masterzen/nginx-upload-progress-module
### This requires the Filefield Nginx Progress module:
### http://drupal.org/project/filefield_nginx_progress.

## 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 ~ (?<upload_form_uri>.*)/x-progress-id:(?<upload_id>\d*) {
    rewrite ^ $upload_form_uri?X-Progress-ID=$upload_id;
}

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