1

Can anyone help me with nginx "location" I want to add this block to my nginx conf

 location / {
       limit_conn zone_name 8; 
     }

I need to modify location to /folder/index.php?file=x Where x can be an string (e.g 7fe8j)

Thanks

2
  • I'm not sure that I understand the problem. If you add that block to your nginx config, what doesn't work?
    – nickgrim
    Aug 28, 2012 at 11:52
  • it works fine , but now i don't want location to be / .Rather i want location to be /folder/index.php?file=x Where x can be an string
    – Werulz
    Aug 28, 2012 at 12:43

1 Answer 1

0

I need to modify location to /folder/index.php?file=x Where x can be an string (e.g 7fe8j)

The short answer is you can't.

limit_conn directive only works in http, server, location context. And location directive only match against the URI (/folder/index.php) without query parameters (?file=x).

3
  • Ohh ......then it is possible to make it match /folder/index.php?file.The ?file is important for me as all file to be downloaded has this in their link.My objective is to control the max number of concurrent connections a downloader can make
    – Werulz
    Aug 29, 2012 at 8:44
  • ?file can be match by using if ($args ~ "^file=(.*)") { but you'll get the [emerg] "limit_conn" directive is not allowed here in message if you put a limit_conn directive inside.
    – quanta
    Aug 29, 2012 at 8:58
  • ohh.....any other way to limit connection for /folder/index.php?file=
    – Werulz
    Aug 30, 2012 at 3:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .