example of upload_module for PHP fastcgi

Oon Arfiandwi oo.if.id at gmail.com
Sat Aug 22 19:31:13 MSD 2009


Oops,
Sorry All, i already found the answer.
the problem is solve.

I read this archive:
http://article.gmane.org/gmane.comp.web.nginx.english/13269/match=upload_module

then i found that the backend can use "fastcgi_pass" not only "proxy_pass".

now I'm using this configuration:
    location /upload {
        # Pass altered request body to this location
        upload_pass   @uploadinternal;

       .....
    }

    location @uploadinternal {
        #proxy_pass   http://localhost:9000;
        fastcgi_pass 127.0.0.1:9000;
        include /usr/local/nginx/conf/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /home/html/example.php;
    }



On Sat, Aug 22, 2009 at 9:34 PM, Oon Arfiandwi<oo.if.id at gmail.com> wrote:
> Hi All,
> I'm new on nginx.
>
> I try to create upload application using PHP.
> I already configure ubuntu + nginx + php-fcgi + nginx_upload_module-2.0.9.
>
> is there any URL for nginx configuration sample of upload application
> (in detail)?
>
> I found example.php on
> http://github.com/vkholodkov/nginx-upload-module/tree/master
> but I don't know how to configure the nginx, so the example can
> successfully run.
>
> I try nginx.conf from the same URL, but I didn't understand about this:
> -----
> # Pass altered request body to a backend
> location /test {
>    proxy_pass   http://localhost:8080;
> }
> -----
>
> what is a backend?
> should I pass to the port of php-fcgi (localhost:9000)?
> when i try to pass to php-fcgi I got this error:
> [error] 11706#0: *1 recv() failed (104: Connection reset by peer)
> while reading response header from upstream, client: a.b.c.d, server:
> domain.name, request: "POST /upload HTTP/1.1", upstream:
> "http://127.0.0.1:9000/upload"
>
> where should I put my program to detect the file, the upload storage, and so on?
>
> thank you for your help.
>





More information about the nginx mailing list