[Seaside] Using nginx file upload module

Johan Brichau johan at inceptive.be
Sun Jun 12 09:28:33 UTC 2011


Hi all,

I'm calling for people who have got the nginx file upload module to work in their seaside apps...

We are trying to use the Nginx file upload module but are stuck when the request needs to get passed on to seaside.
We are using a configuration with a separate '/upload' location that gets handled by the file upload module. The request then needs to get passed to the upstream backend (seaside) but that request still has the URI '/upload' and we do not seem to get it rewritten to the '/seasideapp' URI.


Is there anyone who has this working completely and could give us some advice on how solve this?

The relevant parts of our nginx conf look like this:
We also tried with a named location, but according to the docs, that makes the request arguments be dropped (and we need the _s & _k args for seaside...)

Johan

----

	location / {
			 include fastcgi_params;
			 fastcgi_pass seaside;
		}
	
	# Upload form should be submitted to this location
	location /upload {
					
		# Pass altered request body to this location
		upload_pass /backend;
		upload_pass_args on;
		
		
		#Pass all fields of the form
		upload_pass_form_field ".*";

		# Store files to this directory
		upload_store /var/www/documents/;
       
	    	# Set specified fields in request body
	    	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_cleanup 400 404 499 500-505;
		        }
		
	location /backend
	{
		rewrite ^/upload/(.*) /seasideapp/$1 last;
	}


More information about the seaside mailing list