There are several downloads on the server that satisfy the regex location:

location ~* /(en/ru)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+\.exe){ access_log /var/www/logs/any.access.log} 

There are not so many files (about 10), so I would like for each download to have its own log file. How can I use $ 1, $ 2, $ 3 from the location of the expression to form the path to the log file?

For example: for the file /en/disk/disk-setup.exe, I want the log file /var/www/logs/disk-setup.exe.access.log and so on.

  • No answers? Even the answer "No," would come up, otherwise I smoked all the cigarettes in the smoking room waiting!) <Img src = " admin.hashcode.ru/vote/5327/up " width = "1px" height = "1px" /> - org Nov.

1 answer 1

 access_log /var/www/logs/$uri 

But, consider slashes in the file path and other stupid characters.

  • I picked up the idea, thanks! it is possible to collect in a variable that is necessary! - org