3
location /slides/*/ {
  autoindex on;
  charset utf-8;
}

does not work. how would I open all subdirectories under /slides/ to allow autoindex?

ivo Welch
  • 643

2 Answers2

1

You have to specify the ~ for regex patterns:

location ~ /slides/*/ {
  autoindex on;
  charset utf-8;
}
0

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.

  • maybe this is how it should be, but I don't think this was the case here. I only had autoindex on, never turned off anywhere else. but location ~ /slides/*/ worked. – ivo Welch Oct 17 '22 at 22:09