Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nginx
GitHub Repository: nginx/nginx.org
Path: blob/main/xml/en/docs/syntax.xml
1 views
1
<!--
2
Copyright (C) Igor Sysoev
3
Copyright (C) Nginx, Inc.
4
-->
5
6
<!DOCTYPE article SYSTEM "../../../dtd/article.dtd">
7
8
<article name="Configuration file measurement units"
9
link="/en/docs/syntax.html"
10
lang="en"
11
rev="4">
12
13
<section id="summary">
14
15
<para>
16
nginx supports several measurement units for specifying
17
sizes, offsets, and time intervals within configuration files.
18
</para>
19
20
</section>
21
22
23
<section id="size" name="Sizes and offsets">
24
25
<para>
26
Sizes can be specified in bytes, kilobytes, or megabytes
27
using the following suffixes:
28
29
<list type="bullet">
30
31
<listitem>
32
<literal>k</literal> and <literal>K</literal> for kilobytes
33
</listitem>
34
35
<listitem>
36
<literal>m</literal> and <literal>M</literal> for megabytes
37
</listitem>
38
39
</list>
40
</para>
41
42
<para>
43
For example,
44
<literal>1024</literal>”, “<literal>8k</literal>”, “<literal>1m</literal>”.
45
</para>
46
47
<para>
48
Offsets can be also specified in gigabytes using the
49
<literal>g</literal> or <literal>G</literal> suffixes.
50
</para>
51
52
</section>
53
54
55
<section id="time" name="Time intervals">
56
57
<para>
58
Time intervals can be specified in milliseconds, seconds,
59
minutes, hours, days and so on, using the following suffixes:
60
<table width="30%">
61
<tr><td width="20%">ms</td><td>milliseconds</td></tr>
62
<tr><td width="20%">s</td><td>seconds (default)</td></tr>
63
<tr><td width="20%">m</td><td>minutes</td></tr>
64
<tr><td width="20%">h</td><td>hours</td></tr>
65
<tr><td width="20%">d</td><td>days</td></tr>
66
<tr><td width="20%">w</td><td>weeks</td></tr>
67
<tr><td width="20%">M</td><td>months, 30 days</td></tr>
68
<tr><td width="20%">y</td><td>years, 365 days</td></tr>
69
</table>
70
</para>
71
72
<para>
73
Multiple units can be combined in a single value
74
by specifying them in the order from the most to the least significant,
75
and optionally separated by whitespace.
76
For example, “<literal>1h 30m</literal>” specifies the same time
77
as “<literal>90m</literal>” or “<literal>5400s</literal>”.
78
</para>
79
80
<para>
81
<list type="bullet">
82
83
<listitem>
84
<para>
85
A value without a suffix means seconds.
86
</para>
87
</listitem>
88
89
<listitem>
90
<para>
91
It is recommended to always specify a suffix.
92
</para>
93
</listitem>
94
95
<listitem>
96
<para>
97
Certain time intervals can be specified only with a seconds resolution.
98
</para>
99
</listitem>
100
101
</list>
102
</para>
103
104
</section>
105
106
</article>
107
108