Path: blob/main/xml/en/docs/http/ngx_http_index_module.xml
1 views
<?xml version="1.0"?>12<!--3Copyright (C) Igor Sysoev4Copyright (C) Nginx, Inc.5-->67<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">89<module name="Module ngx_http_index_module"10link="/en/docs/http/ngx_http_index_module.html"11lang="en"12rev="2">1314<section id="summary">1516<para>17The <literal>ngx_http_index_module</literal> module processes requests18ending with the slash character (‘<literal>/</literal>’).19Such requests can also be processed by the20<link doc="ngx_http_autoindex_module.xml">ngx_http_autoindex_module</link>21and22<link doc="ngx_http_random_index_module.xml">ngx_http_random_index_module</link>23modules.24</para>2526</section>272829<section id="example" name="Example Configuration">3031<para>32<example>33location / {34index index.$geo.html index.html;35}36</example>37</para>3839</section>404142<section id="directives" name="Directives">4344<directive name="index">45<syntax><value>file</value> ...</syntax>46<default>index.html</default>47<context>http</context>48<context>server</context>49<context>location</context>5051<para>52Defines files that will be used as an index.53The <value>file</value> name can contain variables.54Files are checked in the specified order.55The last element of the list can be a file with an absolute path.56Example:57<example>58index index.$geo.html index.0.html /index.html;59</example>60</para>6162<para>63It should be noted that using an index file causes an internal redirect,64and the request can be processed in a different location.65For example, with the following configuration:66<example>67location = / {68index index.html;69}7071location / {72...73}74</example>75a “<literal>/</literal>” request will actually be processed in the76second location as “<literal>/index.html</literal>”.77</para>7879</directive>8081</section>8283</module>848586