Example of upload_module for PHP fastcgi

Hi All,
I’m new on nginx.

I try to create upload application using PHP.
I already configure ubuntu + nginx + php-fcgi +

is there any URL for nginx configuration sample of upload application
(in detail)?

I found example.php on

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:

where should I put my program to detect the file, the upload storage,
and so on?

thank you for your help.

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

I read this archive:

then i found that the backend can use “fastcgi_pass” not only

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;
    include /usr/local/nginx/conf/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /home/html/example.php;

Oon Arfiandwi wrote:

GitHub - vkholodkov/nginx-upload-module: A module for nginx web server for handling file uploads using multipart/form-data encoding (RFC 1867).

what is a backend?

A backend is arbitrary entity which handles altered requests from upload
module. That could be (at the moment) a proxied web server, a fastcgi
application or another nginx module.