S
S
Sergey Abramov2020-02-03 14:29:14
Nginx
Sergey Abramov, 2020-02-03 14:29:14

How to make it so that instead of a directory an archive is given?

There is, for example, a folder on the server: http://server/path1/path2/path3. Depth is not fixed. How can I make a request like the one above open the folder as usual, or the page if there is one to open. And when requesting a view, the http://server/path1/path2/path3.zippath3 folder was archived and given for download. nginx server. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2020-02-03
@inoise

make a pre-archive, put it in another place and set up routing. The reason is simple - the creation of an archive is not very predictable in time and, therefore, it is better not to rely on generation on the fly. If this is not important for the task, then mod_zip

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question