Configuration file measurement units
| Sizes and offsets Time intervals |
nginx supports several measurement units for specifying sizes, offsets, and time intervals within configuration files.
Sizes and offsets
Sizes can be specified in bytes, kilobytes, or megabytes using the following suffixes:
-
kandKfor kilobytes -
mandMfor megabytes
For example,
β1024β, β8kβ, β1mβ.
Offsets can be also specified in gigabytes using the
g or G suffixes.
Time intervals
Time intervals can be specified in milliseconds, seconds, minutes, hours, days and so on, using the following suffixes:
| ms | milliseconds |
| s | seconds (default) |
| m | minutes |
| h | hours |
| d | days |
| w | weeks |
| M | months, 30 days |
| y | years, 365 days |
Multiple units can be combined in a single value
by specifying them in the order from the most to the least significant,
and optionally separated by whitespace.
For example, β1h 30mβ specifies the same time
as β90mβ or β5400sβ.
-
A value without a suffix means seconds.
-
It is recommended to always specify a suffix.
-
Certain time intervals can be specified only with a seconds resolution.