Skip to content

Instantly share code, notes, and snippets.

@nebolsin
Created March 1, 2011 08:56
Show Gist options
  • Save nebolsin/848854 to your computer and use it in GitHub Desktop.
Save nebolsin/848854 to your computer and use it in GitHub Desktop.
Excerpt from nginx config file for using nginx_upload_module with Rails
location = /videos/ {
upload_pass_form_field "^video";
upload_store /path/to/your/app/tmp/upload;
upload_pass @large_upload;
upload_pass_args on;
upload_store_access all:rw;
upload_set_form_field "$upload_field_name[name]" "$upload_file_name";
upload_set_form_field "$upload_field_name[content_type]" "$upload_content_type";
upload_set_form_field "$upload_field_name[path]" "$upload_tmp_path";
upload_aggregate_form_field "$upload_field_name[md5]" "$upload_file_md5";
upload_aggregate_form_field "$upload_field_name[size]" "$upload_file_size";
upload_cleanup 400 403 404 499 500-505;
error_page 404 @large_upload;
}
location @large_upload {
passenger_enabled on;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment