1 message in ru.sysoev.nginxQuestion about limit zone.
FromSent OnAttachments
Anup ShuklaJan 30, 2008 1:17 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Question about limit zone.Actions...
From:Anup Shukla (anup@public.gmane.org)
Date:Jan 30, 2008 1:17:02 am
List:ru.sysoev.nginx

Hi all,

I am total newbie to nginx (just 2 days old).

Before i jump in to the question, i better explain what i have done.

I have nginx + fastcgi (php) running on a server. This is for a download server.

Every download request is redirected to a php page which checks access from the db and then X-Accel-Redirect's to the internal caching server.

The caching server fetches the file and sends it to the user via nginx.

The configuration is something like this.

http { .. .. limit_zone conn 32k; root /path/to/php/files; index index.php;

server { location /download { rewrite ^/download/(.*)$ /download.php?q=$1 last; }

location ~ \.php { # fastcgi setup. ... ... }

location /cache/ { internal; proxy_pass http://addr.of.cache.server/; limit_conn conn 1; error_page 503 /error503.php; } } }

I hope that makes sense.

I put the error_page under the *internal* location directive as i do not want to limit connections on other pages.

Now, i would like to know if there is any way to tell download.php the exact number of sessions active for the requesting user?

If this can be done, i can know beforehand if the user is already downloading, and *not* process his request at all.

Thank you for the help.