Permalink
Browse files

* New layout of uploqd progress bar support.

  • Loading branch information...
perusio committed Nov 18, 2012
1 parent d6c0911 commit e964a590602291a35a4d2e4b5f02cd31acc8581b
Showing with 82 additions and 31 deletions.
  1. +13 −13 README.md
  2. +24 −0 apps/drupal/drupal6_upload_progress.conf
  3. +23 −0 apps/drupal/drupal_upload_progress.conf
  4. +22 −18 sites-available/example.com.conf
View
@@ -103,44 +103,44 @@ version.
1. I'm **not** using [Boost](http://drupal.org/project/boost):
* On **drupal 7** use the `drupal.conf` config in your vhost
- (`server` block): `include sites-availables/drupal.conf;`.
+ (`server` block): `include apps/drupals/drupal.conf;`.
* On **drupal 7** having to serve URIs that need to be **escaped**,
e.g., that have `+` and/or `?` then use the `drupal_escaped.conf`
config in your vhost (`server` block):
- `include sites-available/drupal_escaped.conf`.
+ `include apps/drupal/drupal_escaped.conf`.
* On **drupal 6** use the `drupal6.conf` config in your vhost
- (`server` block): `include sites-availables/drupal6.conf;`.
+ (`server` block): `include apps/drupals/drupal6.conf;`.
* On **drupal 6** if having to serve URIs that need to be
**escaped**, e.g., that have `+` and/or `?` then use the
`drupal6_escaped.conf` config in your vhost (`server` block):
- `include sites-available/drupal6_escaped.conf`.
+ `include apps/drupal/drupal6_escaped.conf`.
2. I'm using [Boost](http://drupal.org/project/boost) for caching
on my drupal site.
* On **drupal 7** use the `drupal_boost.conf` config in your vhost
- (`server` block): `include sites-available/drupal_boost.conf;`.
+ (`server` block): `include apps/drupal/drupal_boost.conf;`.
* On **drupal 7** if having to serve URIs that need to be
**escaped**, e.g., that have `+` and/or `?` then use the
`drupal_boost_escaped.conf` config in your vhost (`server` block):
- `include sites-available/drupal_boost_escaped.conf`.
+ `include apps/drupal/drupal_boost_escaped.conf`.
* On **drupal 6** use the `drupal_boost6.conf` config in your vhost
- (`server` block): `include sites-available/drupal_boost6.conf;`.
+ (`server` block): `include apps/drupal/drupal_boost6.conf;`.
* On **drupal 6** if having to serve URIs that need to be
**escaped**, e.g., that have `+` and/or `?` then use the
`drupal_boost6_escaped.conf` config in your vhost (`server`
- block): `include sites-available/drupal_boost6_escaped.conf`.
+ block): `include apps/drupal/drupal_boost6_escaped.conf`.
3. I'm **not using drush** for updating and running
cron. Additionally you should also include the
`drupal_cron_update.conf` config in your vhost (`server` block):
- `include sites-available/drupal_cron_update.conf;`
+ `include apps/drupal/drupal_cron_update.conf;`
4. I'm using **drupal 8**. Just use the drupal 7 configuration. The
only thing that changes so far is the location of `install.php`.
@@ -663,18 +663,18 @@ This is strictly a **drupal 6** issue.
microcache is enabled. If you want to use the **authenticated** user
microcache instead comment out the line:
- 1. `include sites-available/microcache_fcgi.conf` if using the FCGI
+ 1. `include apps/drupal/microcache_fcgi.conf` if using the FCGI
microcache (when proxying to FCGI).
- 2. `include sites-available/microcache_proxy.conf` if using the
+ 2. `include apps/drupal/microcache_proxy.conf` if using the
proxy cache (proxying to Apache or other PHP handler).
and uncomment:
- 1. `include sites-available/microcache_fcgi_auth.conf` if using the FCGI
+ 1. `include apps/drupal/microcache_fcgi_auth.conf` if using the FCGI
microcache (when proxying to FCGI).
- 2. `include sites-available/microcache_proxy_auth.conf` if using the
+ 2. `include apps/drupal/microcache_proxy_auth.conf` if using the
proxy cache (proxying to Apache or other PHP handler).
You're set to go.
@@ -0,0 +1,24 @@
+# -*- mode: nginx; mode: flyspell-prog; ispell-current-dictionary: american -*-
+
+### Drupal 6 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>\w*) {
+ 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 {
+ ## Comment out the line below if you're using a version
+ ## of the Nginx Upload Progress module less than 0.9.0.
+ upload_progress_java_output; # this for version 0.9.0 of the module
+ report_uploads uploads;
+}
@@ -0,0 +1,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;
+}
@@ -59,29 +59,29 @@ server {
################################################################
### Generic configuration: for most Drupal 7 sites.
################################################################
- include sites-available/drupal.conf;
+ include apps/drupal/drupal.conf;
################################################################
### Generic configuration: for most Drupal 6 sites.
################################################################
- # include sites-available/drupal6.conf;
+ # include apps/drupal/drupal6.conf;
#################################################################
### Configuration for Drupal 7 sites that use boost.
#################################################################
- #include sites-available/drupal_boost.conf;
+ #include apps/drupal/drupal_boost.conf;
#################################################################
### Configuration for Drupal 6 sites that use boost.
#################################################################
- #include sites-available/drupal_boost6.conf;
+ #include apps/drupal/drupal_boost6.conf;
#################################################################
### Configuration for updating the site via update.php and running
### cron externally. If you don't use drush for running cron use
### the configuration below.
#################################################################
- #include sites-available/drupal_cron_update.conf;
+ #include apps/drupal/drupal_cron_update.conf;
## For upload progress to work. From the README of the
## filefield_nginx_progress module.
@@ -161,39 +161,43 @@ server {
################################################################
### Generic configuration: for most Drupal 7 sites.
################################################################
- include sites-available/drupal.conf;
+ include apps/drupal/drupal.conf;
################################################################
### Generic configuration: for most Drupal 6 sites.
################################################################
- # include sites-available/drupal6.conf;
+ # include apps/drupal/drupal6.conf;
#################################################################
### Configuration for Drupal 7 sites that use boost.
#################################################################
- #include sites-available/drupal_boost.conf;
+ #include apps/drupal/drupal_boost.conf;
#################################################################
### Configuration for Drupal 6 sites that use boost.
#################################################################
- #include sites-available/drupal_boost6.conf;
+ #include apps/drupal/drupal_boost6.conf;
#################################################################
### Configuration for updating the site via update.php and running
### cron externally. If you don't use drush for running cron use
### the configuration below.
#################################################################
- #include sites-available/drupal_cron_update.conf;
+ #include apps/drupal/drupal_cron_update.conf;
- ## For upload progress to work. From the README of the
- ## filefield_nginx_progress module.
- location ~ ^(.*)/x-progress-id:(\w*) {
- return 302 $1?X-Progress-ID=$2;
- }
- location ^~ /progress {
- report_uploads uploads;
- }
+ #################################################################
+ ### Support for upload progress bar. Configurations differ for
+ ### Drupal 6 and Drupal 7.
+ #################################################################
+
+ ## This is for Drupal 7. Comment out the line below if you're on
+ ## Drupal 6.
+ include apps/drupal/drupal_upload_progress.conf;
+
+ ## This is for Drupal 6. Comment out the line above and uncomment
+ ## the line below if you're on Drupla 6.
+ #include apps/drupal/drupal6_upload_progress.conf;
## Including the php-fpm status and ping pages config.
## Uncomment to enable if you're running php-fpm.

0 comments on commit e964a59

Please sign in to comment.