Limiting user access to static files

Hello,

I am looking forward to use nginx for serving my static contents. I want
to limit the number of accesses to any static file (# of open file
handles to these files) to 1 so that only 1 access is allowed at a time
per file. Is there a way to handle this in nginx?

blasfamous

On Wed, Jan 09, 2008 at 02:07:17AM +0100, Blasfamous As usual wrote:

I am looking forward to use nginx for serving my static contents. I want
to limit the number of accesses to any static file (# of open file
handles to these files) to 1 so that only 1 access is allowed at a time
per file. Is there a way to handle this in nginx?

You may try

http {
    limit_zone   uri  $uri  10m;

    ...

    server {

        ...

        location /static/ {
            limit_conn   uri  1;
        }

However, now limit_zone has limit of 255 length variable value, so
you can not use for URIs longer than 255.

I will probaly fix it after my vacation.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs