HTTP directives
autoindex directive (HTTP)
Controls generated directory listings, typically when a slash-ending request has no usable index. Default: off. Context: http, server, location. Keep off unless content is intentionally public.
Formal Syntax & Structure
nginx syntaxnginx
autoindex on | off;Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| state | enum | on enables listing; off disables it. |
Working Example
Example Snippetnginx
location / { autoindex off;}