<!-- review: finished -->

<a id="http-random-index"></a>

# Random Index

The module processes requests ending with the slash character (`/`) and picks a random file in a directory to serve as an index file. The module is processed before the `http_index` module.

When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild),
this module isn't built by default;
it should be enabled with the
`‑‑with‑http_random_index_module`
[build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure).

In packages and images from [our repos](https://en.angie.software//angie/docs/installation/index.md#install-packages),
the module is included in the build.

<a id="configuration-example-35"></a>

## Configuration Example

```nginx
location / {
    random_index on;
}
```

<a id="directives-36"></a>

## Directives

<a id="index-0"></a>

<a id="id1"></a>

### random_index

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `random_index` `on` | `off`;   |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default                                                                                  | `random_index off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | location                       |

Enables or disables module processing in a surrounding location.
