jQuery-File-upload and nginx

I have a problem setting up jQuery-File-Upload plugin and nginx. I’ve
downloaded and installed nginx 1.2.3, and upload module 2.2.0 from
here’s my config file (names have been changed to protect the innocent):
upstream web_backend {
server 4dc1.domain.com:8080 weight=10 max_fails=3;
server 4dc1.domain.com:8081 weight=10 max_fails=3;
server 4dc2.domain.com:8080 weight=10 max_fails=3;
server 4dc2.domain.com:8081 weight=10 max_fails=3;

server {
listen 80;
listen 8080;
server_name domain.com www.domain.com;
/var/www/vhosts/domain.com/statistics/logs/error_log.nginx warn;
/var/www/vhosts/domain.com/statistics/logs/access_log.nginx main
root /var/www/vhosts/domain.com/httpdocs/website;

auth_basic “Restricted”;

auth_basic_user_file .htpasswd;

    index   index.html;

    location / {
            expires 7d;

    error_page 404  /404.html;

    error_page 500 502 503 504 /50x.html;

    location = /50x.html {
            root /var/www/vhosts/domain.com/httpdocs/website;

    location = /404.html {
            root /var/www/vhosts/domain.com/httpdocs/website;

    location /img/ {

auth_basic off;

            expires 10m;

    location ~*

expires 7d;

    location /jsonrpc/ {
            proxy_pass http://web_backend$request_uri;
            include /etc/nginx/proxy.conf;

    location /upload/ {
            upload_pass @test;

            upload_store /path/to/file/store/ 1;
            upload_store_access user:rw group:rw;

            upload_set_form_field $upload_field_name.name

upload_set_form_field $upload_field_name.content_type
upload_set_form_field $upload_field_name.path

            upload_aggregate_form_field "$upload_field_name.md5"

upload_aggregate_form_field “$upload_field_name.size”

            upload_pass_form_field "^submit$ | ^description$";
            upload_cleanup 400 404 499 500-505;

   location @test {
           proxy_pass   http://localhost:8080;


The html file contains a form with method set to “POST”, hence the
module. Here’s the relevant bits of the html file:

Add files…

Start upload

Cancel upload



I keep getting 405 Not allowed error.
How can I get jQuery-File-Upload and nginx to work together?

Posted at Nginx Forum: