Forum: NGINX Location issues with upload progress module

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
56080a668b706e94fb2bbe9ee727d006?d=identicon&s=25 Reinis Rozitis (Guest)
on 2008-10-08 13:55
(Received via mailing list)
Hi,
maybe somebody can tell how to work arround this. While its not a big
issue
and seems more related to Nginx overal location mechanics.

I have played arround Nginx Upload Progress Module (
http://wiki.codemongers.com/NginxHttpUploadProgressModule )

The problem is afteradding the proxy_pass location (according to docs)
nginx
( 0.7.17 ) forgets/doesnt use index.php on that path anymore as
directory
index ..

eg http://myserver.com/up/ returns 502 Bad Gateway:

2008/10/08 14:20:56 [error] 3249#0: *1023 recv() failed (104: Connection
reset by peer) while reading response header from upstream, client:
127.0.0.1, server: _, request: "GET /up/ HTTP/1.0", upstream:
"http://127.0.0.1:80/up/", host: "127.0.0.1"

while http://myserver.com/up/index.php works fine....


The configuration:
------------------------------------------------------------
http {
...
  upload_progress proxied 5m;

  server {
..
       root   /data/web/root;
       index  index.php index.htm;

    location /up {
        proxy_pass http://127.0.0.1;
        proxy_redirect default;
        track_uploads proxied 10s;
     }

     location ~ \.php$ {

                if (!-f $request_filename) {
                        return 404;
                }
                fastcgi_pass   127.0.0.1:1026;
                fastcgi_index  index.php;
                include        fastcgi_params;

                track_uploads proxied 10s;
     }

  location ^~ /progress {
    # report uploads tracked in the 'proxied' zone
    report_uploads proxied;
  }
 }
}
------------------------------------------------------------



While I can leave the 'location /up' directive out of config at all what
enables upload progress support on every *.php wanted to know if there
is
something wrong (directive order) or missing or just supposed to work
like
that?


wbr
rr
Abbd9d5312c5d54114a96a35dc94fdb1?d=identicon&s=25 Valery Kholodkov (Guest)
on 2008-10-08 14:13
(Received via mailing list)
> ( 0.7.17 ) forgets/doesnt use index.php on that path anymore as directory
>
>        index  index.php index.htm;
>                         return 404;
>     report_uploads proxied;
> that?
Because location /up {} enables proxy for all locations starting from
"/up". If you want only exact URI "/up" to be affected by proxy
configuration, you should specify

location = /up {
         proxy_pass http://127.0.0.1;
         proxy_redirect default;
         track_uploads proxied 10s;
}
This topic is locked and can not be replied to.