vkholodkov/nginx-upload-module — Issue #25: could not find named location
Author: mark-hahn
Created: 2011-12-01 00:18:16+00:00
State: open

I'm getting this error: `could not find named location "http://localhost:81"`. The value, http://localhost:81, is the identical location I use for proxy_pass and it works fine.

My full config is:

server {
listen 80;

location ~* \/(favicon.ico$|apple-tou.*|robots.txt$) {
root /ria/src/views/images/favicons;
}

location ~ /(common/|views/(js|css)/|views/images/|views/pages/[^/]+_client\.js$|notification/images/).* {
root /ria/src;
}

location ~ \/ria\/.*(\.jpg|\.jpeg|\.gif|\.png)$$ {
proxy_pass	http://localhost:5984;
proxy_set_header	X-Real-IP $remote_addr;
proxy_set_header	Authorization "Basic cm9vdDp0Ymdjb21wczI=";
}

location / {
proxy_pass	http://localhost:81;
proxy_set_header	X-Real-IP $remote_addr;
}

location /upload {
client_max_body_size	0;
upload_max_file_size	0;
upload_pass	http://localhost:81;
upload_store	/mnt/uploads 1;

upload_set_form_field $upload_field_name.name "$upload_file_name";
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
upload_aggregate_form_field "$upload_field_name.sha1" "$upload_file_sha1";
upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size";
#upload_pass_form_field "^fallback$|^login$|^usession$";
upload_cleanup 400 404 499 500-505;
}

# Stop Image and Document Hijacking
location ~* (\.jpg|\.jpeg|\.gif|\.png)$ {
if ($http_referer !~ ^(https?:\/\/[^\/]*comps2.info) ) {
return 444;
}
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /ria/etc/nginx/html;
}
#error_page 404 /404.html;
#charset koi8-r;
}