L
L
likejavascript2015-04-13 08:21:50
Nginx
likejavascript, 2015-04-13 08:21:50

How to form a file structure for uploaded files through nginx_module_upload?

I use the nginx_module_upload module to upload and store images. After that they are given to nginx through image_filter according to this example Fast resize and caching of images The
question is that I don't understand how to correctly form the file structure for uploaded images?
In the nginx_module_upload module, if the directive that allows you to create hashed directories of any level:

upload_store <directory> [<level 1> [<level 2> ] ... ]

But in the config example that returns images, they are all returned by one parameter ($3):
location ~* ^/resize/([\d\-]+)/([\d\-]+)/(.+)$ {
   alias <STORAGE_ROOT>/$3;
   image_filter resize $1 $2;
   image_filter_buffer 2M;
   error_page 415 = /empty;
}

I would like to identify a picture by id and get it through nginx in the way described above. Tell me what are the options for forming a file structure for pictures and identifying them?
And tell me please how many images can be kept in one directory?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question