Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit af8f26b

Browse files
committed
configuration: Add settings/http/compression section
This is for configuring HTTP compression support. Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent 9f83b8d commit af8f26b

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

source/configuration/index.rst

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5476,6 +5476,12 @@ In turn, the **http** option exposes the following settings:
54765476
54775477
The default is 30.
54785478
5479+
* - **compression**
5480+
- Object:
5481+
HTTP compression configuration
5482+
5483+
*(since 1.35.0)*
5484+
54795485
* - **discard_unsafe_fields**
54805486
- Boolean;
54815487
controls header field name parsing.
@@ -5594,6 +5600,75 @@ In turn, the **http** option exposes the following settings:
55945600
**.webp**, **.woff2**, **.woff**, **.xml**, and
55955601
**.zip**.
55965602
5603+
The **compression** option exposes the following settings:
5604+
5605+
.. list-table::
5606+
:header-rows: 1
5607+
5608+
* - Option
5609+
- Description
5610+
5611+
* - **types**
5612+
- Array:
5613+
list of MIME types that are considered for compression.
5614+
5615+
* - **compressors**
5616+
- Array:
5617+
list of compressors to enable.
5618+
5619+
The **compressors** option exposes the following settings:
5620+
5621+
.. list-table::
5622+
:header-rows: 1
5623+
5624+
* - Option
5625+
- Description
5626+
5627+
* - **encoding** (required)
5628+
- The compression method to enable.
5629+
5630+
Depending on how Unit was built, the supported encodings are any or all
5631+
of; gzip, deflate, zstd & br.
5632+
5633+
* - **level**
5634+
- The compression level to use.
5635+
5636+
If not specified the default of the specified encode is used.
5637+
5638+
* - **min_length**
5639+
- The minimumn length of data to be considreed for compression.
5640+
5641+
If set to 0 or not specified then there is no minimum amount of dats
5642+
that will be considreed before compressing.
5643+
5644+
Example:
5645+
5646+
.. code-block:: json
5647+
5648+
"compression": {
5649+
"types": [
5650+
"text/*"
5651+
],
5652+
"compressors": [
5653+
{
5654+
"encoding": "gzip",
5655+
"level": 3,
5656+
"min_length": 4096
5657+
},
5658+
{
5659+
"encoding": "deflate",
5660+
"min_length": 0
5661+
},
5662+
{
5663+
"encoding": "zstd",
5664+
},
5665+
{
5666+
"encoding": "br",
5667+
"min_length": 1024
5668+
}
5669+
]
5670+
}
5671+
55975672
The **telemetry** option exposes the following settings:
55985673
55995674
.. list-table::

0 commit comments

Comments
 (0)