upload progress and upload module

56 views
Skip to first unread message

Brian Smith

unread,
Aug 6, 2009, 5:12:36 PM8/6/09
to Phusion Passenger Discussions
I am trying to get the upload module and upload progress modules work
with passenger, but I'm having trouble with the config. I mean since
there's no upstream servers, what do I feed the proxy_pass? Any tips
would be greatly appreciated. The localhost path doesn't seem to work.

Sample config:

server {
listen 80;
server_name *.example.com;
root /data/website/public;
passenger_enabled on;
rails_env production;
location /photos {
upload_pass /upload;
upload_store /tmp;
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";
}
location /upload {
proxy_pass http://localhost;
}
location / {
proxy_pass http://localhost;
proxy_redirect default;
track_uploads proxied 30s;
}
location ^~ /progress {
report_uploads proxied;
}
}

Brian Smith

unread,
Aug 9, 2009, 8:59:53 PM8/9/09
to Phusion Passenger Discussions
Does know one else use passenger nginx?

On Aug 6, 4:12 pm, Brian Smith <wbsmit...@gmail.com> wrote:
> I am trying to get the upload module and upload progress modules work
> with passenger, but I'm having trouble with the config. I mean since
> there's no upstream servers, what do I feed theproxy_pass? Any tips
> would be greatly appreciated. The localhost path doesn't seem to work.
>
> Sample config:
>
>     server {
>         listen       80;
>         server_name  *.example.com;
>         root /data/website/public;
>         passenger_enabled on;
>         rails_env production;
>         location /photos {
>           upload_pass   /upload;
>           upload_store /tmp;
>           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";
>         }
>         location /upload {
>          proxy_passhttp://localhost;
>         }
>         location / {
>          proxy_passhttp://localhost;

Daniel Jagszent

unread,
Aug 10, 2009, 2:42:45 AM8/10/09
to phusion-...@googlegroups.com
Hi Brian,

> I am trying to get the upload module and upload progress modules work
> with passenger, but I'm having trouble with the config. I mean since
> there's no upstream servers, what do I feed the proxy_pass? Any tips
> would be greatly appreciated. The localhost path doesn't seem to work.
>
> Sample config:
> [...]
>

I'm not an expert on this but since nobody else replied I thought I give
it a try. I never used nginx's upload module so I don't know for sure -
but I recall that you have to specify "pasenger_enabled on;" in every
location block that you want passenger to be enabled. AFAIK it gets not
propagated to them.

Try this config:

server {
listen 80;
server_name *.example.com;
root /data/website/public;

rails_env production;
location /photos {
passenger_enabled on; # if you need it here


upload_pass /upload;
upload_store /tmp;
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";
}
location /upload {

passenger_enabled on;
}
location / {
passenger_enabled on;


track_uploads proxied 30s;
}
location ^~ /progress {
report_uploads proxied;
}
}


I might want to use the upload and upload_progress modules in the future
- if you find a working config I would appreciated it if you could post
it back here.

Andy Lo-A-Foe

unread,
Aug 13, 2009, 6:25:19 PM8/13/09
to Phusion Passenger Discussions
Hi,

I ran into this problem today and your suggestion to add
passenger_enabled to the location block did the trick, so I can
confirm upload_progress works with nginx+passenger! Thanks..

Regards,
Andy
> I might want to use the upload andupload_progressmodules in the future
Reply all
Reply to author
Forward
0 new messages