Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nginx
GitHub Repository: nginx/nginx.org
Path: blob/main/xml/en/docs/http/ngx_http_index_module.xml
1 views
1
<?xml version="1.0"?>
2
3
<!--
4
Copyright (C) Igor Sysoev
5
Copyright (C) Nginx, Inc.
6
-->
7
8
<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9
10
<module name="Module ngx_http_index_module"
11
link="/en/docs/http/ngx_http_index_module.html"
12
lang="en"
13
rev="2">
14
15
<section id="summary">
16
17
<para>
18
The <literal>ngx_http_index_module</literal> module processes requests
19
ending with the slash character (‘<literal>/</literal>’).
20
Such requests can also be processed by the
21
<link doc="ngx_http_autoindex_module.xml">ngx_http_autoindex_module</link>
22
and
23
<link doc="ngx_http_random_index_module.xml">ngx_http_random_index_module</link>
24
modules.
25
</para>
26
27
</section>
28
29
30
<section id="example" name="Example Configuration">
31
32
<para>
33
<example>
34
location / {
35
index index.$geo.html index.html;
36
}
37
</example>
38
</para>
39
40
</section>
41
42
43
<section id="directives" name="Directives">
44
45
<directive name="index">
46
<syntax><value>file</value> ...</syntax>
47
<default>index.html</default>
48
<context>http</context>
49
<context>server</context>
50
<context>location</context>
51
52
<para>
53
Defines files that will be used as an index.
54
The <value>file</value> name can contain variables.
55
Files are checked in the specified order.
56
The last element of the list can be a file with an absolute path.
57
Example:
58
<example>
59
index index.$geo.html index.0.html /index.html;
60
</example>
61
</para>
62
63
<para>
64
It should be noted that using an index file causes an internal redirect,
65
and the request can be processed in a different location.
66
For example, with the following configuration:
67
<example>
68
location = / {
69
index index.html;
70
}
71
72
location / {
73
...
74
}
75
</example>
76
a “<literal>/</literal>” request will actually be processed in the
77
second location as “<literal>/index.html</literal>”.
78
</para>
79
80
</directive>
81
82
</section>
83
84
</module>
85
86