location /slides/*/ {
autoindex on;
charset utf-8;
}
does not work. how would I open all subdirectories under /slides/ to allow autoindex?
You have to specify the ~ for regex patterns:
location ~ /slides/*/ {
autoindex on;
charset utf-8;
}
There is no location wildcard in Nginx and it is not necessary.
location /slides/ matches URLs which begin with /slides/ and this includes all paths and directories below it unless another location takes precedence.
See how Nginx processes a request and the location directive.
autoindex on, never turned off anywhere else. but location ~ /slides/*/ worked.
– ivo Welch
Oct 17 '22 at 22:09
location ~ /slides/*/orlocation = /slides/*/? – Edgar Magallon Oct 16 '22 at 20:37location ~ /slides/*/*,location = /slides/*/*(adding*at the end of the path) – Edgar Magallon Oct 16 '22 at 20:39location ~ /slides/*/does the job. can you add this as an answer for me to accept, please? – ivo Welch Oct 17 '22 at 22:08