# https://en.angie.software/angie/docs.md
# About Angie
Angie
/[andʒi](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet)/
is an efficient, powerful, and scalable web server
that was forked from nginx:
* Conceived by ex-devs from the original team
to venture beyond the earlier vision
and act as a [drop-in replacement](https://en.angie.software//angie/docs/configuration/migration.md#migration)
without major changes to module setup or configuration.
* Includes most capabilities of
[nginx 1.31.2](https://nginx.org/en/CHANGES)
and a number of [new features](#index-features-oss).
We build binary packages for a range of
[systems and architectures](https://en.angie.software//angie/docs/installation/index.md#install-packages),
as well as
[Docker images](https://en.angie.software//angie/docs/installation/docker.md#docker-images).
The source code is open in our
[public repositories](https://en.angie.software//angie/docs/development.md#development)
under a
[BSD-like license](https://en.angie.software//angie/license-angie.md#license-angie).
Also, a commercial version with [additional features](#index-features-pro)
is marketed as Angie PRO.
A choice of ready-made Angie packages,
Docker images, and source code build options.
Startup and run-time control;
configuration, modules, directives, and variables.
Resolving technical issues with Angie,
available feedback routes.
Information for developers
who want to contribute to the project.
## Current Version
**Angie 1.12.1** and **Angie PRO 1.12.1** were released on **July 17, 2026**.
New versions appear quarterly;
in between, we publish urgent fixes and important updates.
See also the complete version history for
[Angie](https://en.angie.software//angie/docs/oss_changes.md#oss-changes)
and
[Angie PRO](https://en.angie.software//angie/docs/pro_changes.md#pro-changes).
## Angie Advantages over nginx
Core advantages available
in the free open-source version of Angie:
**Observability and monitoring**
- Exposing basic information about the web server,
its [configuration](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#a-api-config-files),
as well as [metrics](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#metrics) of proxied servers, client connections,
shared memory zones, TLS certificates, and many other things
via a RESTful [API](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#a-api) interface in JSON format.
- Collecting arbitrary [custom metrics](https://en.angie.software//angie/docs/configuration/custom-metrics.md#custom-metrics-config)
for [HTTP](https://en.angie.software//angie/docs/configuration/modules/http/http_metric.md#http-metric) and [stream](https://en.angie.software//angie/docs/configuration/modules/stream/stream_metric.md#stream-metric) traffic in
real time with the Metric module, using configurable aggregation methods
(counters, histograms, moving averages, and so on); metrics are grouped by
arbitrary keys and exposed through the statistics API.
- Exporting statistics in [Prometheus](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#id1) format
with [customizable templates](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#prometheus-template).
- Enhanced error logging with the [error_log](https://en.angie.software//angie/docs/configuration/modules/core.md#error-log) directive:
message filtering with the `filter=` parameter, JSON output with the
`format=` parameter, and a configurable logging rate with the
`rate=` parameter, plus custom tags via the
[error_log_user_tag](https://en.angie.software//angie/docs/configuration/modules/http/index.md#error-log-user-tag) directive.
- Monitoring the server through the browser with the
[Console Light](https://en.angie.software//angie/docs/configuration/monitoring.md#monitoring) visual monitoring tool.
See the online demo: [https://console.angie.software/](https://console.angie.software/)
**TLS and security**
- The [ACME](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#id1) client in Angie, enabled in our packages and
images, so there is no separate module to install: automatic issuance
and renewal of TLS certificates with [HTTP, DNS, and TLS-ALPN](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#acme-client) domain validation. DNS validation opens the way to wildcard
certificates, the same automation is available in the `stream` context
through the Stream [ACME](https://en.angie.software//angie/docs/configuration/modules/stream/stream_acme.md#stream-acme) module, and
the [acme_hook](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#acme-hook) directive lets a custom handler fulfill any
of these validation methods.
- TLS 1.3 Early Data (0-RTT) support in the `stream` module.
- [Server](https://en.angie.software//angie/docs/configuration/modules/http/http_ssl.md#ssl-ntls)- and [client-side](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-ssl-ntls)
support for NTLS when using the
[TongSuo](https://github.com/Tongsuo-Project/Tongsuo)
TLS library, enabled [at build time](https://en.angie.software//angie/docs/installation/sourcebuild.md#install-source-features).
**Proxying and load balancing**
- Dynamic updating of upstream groups based on events and labels from
[Docker containers](https://en.angie.software//angie/docs/configuration/modules/http/http_docker.md#http-docker) (or similar tools like Podman) without
server reload.
- Genuine [response-time load balancing](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-least-time): requests go to
the server with the lowest measured response time, tracked as an
exponentially weighted moving average whose
[smoothing factor](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-response-time-factor) is configurable, from inert
averaging to a quick reaction to spikes.
- Recommissioning upstream servers after a failure smoothly
using the `slow_start` option of the [server](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server) directive
in both HTTP and stream upstreams.
- [Session binding](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-sticky) for the protocols of the
`stream` module (TCP/UDP): all connections within one session are
directed to the same proxied server.
- Graceful decommissioning of a proxied server in the `stream` module
with the `drain` option of the [server](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server) directive:
the server stops accepting new connections but keeps serving sessions
already bound to it.
**Protocols and traffic**
- Production-ready [HTTP/3](https://en.angie.software//angie/docs/configuration/modules/http/http_v3.md#http-v3) support for both client and
[proxied server](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-http-version) connections, with the ability to
use different protocol versions (HTTP/1.x, HTTP/2, HTTP/3) independently on
each side (nginx's HTTP/3 is limited to the server side and remains
experimental, [suffering from degradations](https://en.angie.software//news/articles/http3-ebpf.md)
after reloads).
- A built-in [DoH server](https://en.angie.software//angie/docs/configuration/modules/http/http_doh.md#http-doh) (DNS over HTTPS, RFC 8484):
it accepts DNS queries over HTTP/HTTPS and proxies them to DNS server
groups over UDP or TCP.
- Passing PROXY Protocol v2 to proxied servers in the `stream` module,
with the ability to set arbitrary TLV values via the
[proxy_protocol_tlv](https://en.angie.software//angie/docs/configuration/modules/stream/stream_proxy.md#s-proxy-protocol-tlv) directive.
- Converting images between formats, including to HEIC and AVIF,
with the `convert` parameter of the [image_filter](https://en.angie.software//angie/docs/configuration/modules/http/http_image_filter.md#id1) directive.
- Extending authorization and balancing capabilities for the MQTT protocol
with the [mqtt_preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_mqtt_preread.md#s-mqtt-preread) directive under `stream`.
- Informing balancing decisions with RDP protocol's session cookies
via the [rdp_preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_rdp_preread.md#s-rdp-preread) directive under `stream`.
- Limiting the [MP4 file transfer rate](https://en.angie.software//angie/docs/configuration/modules/http/http_mp4.md#mp4-limit-rate)
proportionally to its bitrate,
thus reducing the bandwidth load.
- Support for the XOAUTH2 and OAUTHBEARER
[authentication methods](https://en.angie.software//angie/docs/configuration/modules/mail/mail_smtp.md#m-smtp-auth) in the mail proxy.
**Simpler configuration and operations**
- Automatic [DNS resolver](https://en.angie.software//angie/docs/configuration/modules/http/index.md#resolver) configuration from
`/etc/resolv.conf`: the file is re-read on changes, eliminating the
need to specify DNS server addresses manually.
- Several matching expressions at once in a single `location`
directive: blocks with shared settings can be
[combined](https://en.angie.software//angie/docs/configuration/modules/http/index.md#combined-locations).
- The [goto](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#goto) directive in the rewrite module, performing an
internal redirect to a named location without modifying the URI, in place
of workarounds based on `try_files` or `error_page`.
- Flushing the shared memory zone in [proxy_cache_path](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-path) to disk: the
cache index contents are preserved between restarts and updates,
which eliminates the cache load delay and brings the server online even faster.
- The [time_format](https://en.angie.software//angie/docs/configuration/modules/http/index.md#time-format) directive, defining a variable with a
custom time format, supporting `strftime()`-like specifiers and
`%L` for milliseconds.
- Pre-built [binary packages](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules)
for many popular third-party modules.
## Additional Angie PRO Features
Commercial Angie PRO adds the following
to the [open-source version](#index-features-oss):
**Dynamic configuration and management**
- Managing proxied servers through a RESTful dynamic configuration
[API](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#api-config): servers can be put into and taken out of
balancing, and their weights and other parameters changed on the fly,
without reloading worker processes. The visual monitoring console
[Console Light](https://en.angie.software//angie/docs/configuration/monitoring.md#monitoring) can also be used to manage the server
in your browser.
- Overriding the server signature on error pages and in the `Server`
header field with an arbitrary value using the
[server_tokens](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server-tokens) directive.
**Advanced balancing and fault tolerance**
- Balancing by [feedback](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-feedback): peers are selected by a
variable value; it is assumed to come from the peers themselves,
reporting CPU load or other metrics.
- Waiting queue for requests, configured using the [queue](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-queue)
directive in the `upstream` block: if no server can be picked for a
request on the first attempt, for example during a load spike, it joins
the queue instead of being rejected outright.
- Proactively checking the state of proxied servers by sending periodic
[probing requests](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream_probe.md#u-upstream-probe): a failing server leaves
balancing before a client request reaches it, not after.
- The [no_port](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-no-port) directive in an `upstream` block of
the `stream` module, unbinding the port from the group's servers:
the port is given in the [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/stream/stream_proxy.md#s-proxy-pass) directive, so a single group
can serve proxying to different ports without duplicating the server list.
- The [backup_switch](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-backup-switch) directive in the
`upstream` block: backup servers can continue serving requests
when the primary servers become accessible again.
**Sessions, connections, and caching**
- The [sticky learn](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-sticky) mode with session storage in an
external store, which allows joining multiple balancers in a cluster.
- Conditional [binding of client connections](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-bind-conn)
to the proxied server connection, which also enables proxying NTLM.
- The [proxy_bind](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-bind) directive, evaluating variables after each proxied
server selection: the outgoing address can depend on the selected
server; for example, through the
[$upstream_current_addr](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#v-upstream-current-addr) variable.
- Cache sharding in the proxy module, which enables distributing it across
[different disks](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache) depending on the properties of the response.
# https://en.angie.software/angie/docs/installation.md
# Installation
## Angie
Several installation options are available for the free open-source version:
| [Binary packages](https://en.angie.software//angie/docs/installation/oss_packages.md#oss-packages) | Recommended installation method; we build and publish packages for most Linux distributions and FreeBSD.
Along with this, we also prepare and release our own builds for many [popular third-party modules](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules). |
|------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Docker images](https://en.angie.software//angie/docs/installation/docker.md#docker-images) | To run in a container, you can download the Docker image from our registry. We build images from our own packages based on a wide range of distributions.
The images in the registry contain *all* the modules we build, including third-party ones; there is also a minimal image without additional modules. |
| [Source build](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild) | If the previous options don't suit you for some reason, you can always create your own build from the source code. |
You can suggest new installation methods, modules, and distributions
on the
[forum](https://forum.angie.support)
or on
[GitHub](https://github.com/webserver-llc/angie/issues).
## Angie PRO
The main installation option for the commercial version is
[binary packages](https://en.angie.software//angie/docs/installation/pro_packages.md#pro-packages),
stored in a secure private repository;
to access it, you need to sign a contract and purchase a license.
Builds are available for most POSIX-compatible systems;
in addition, we can create and test your build
for a specific distribution and installation method.
## Third-Party Modules and Other Sources
We prepare and publish builds for many
[popular third-party modules](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules) in our repository.
In addition, for a number of operating systems and distributions,
Angie can be installed from their
[own repositories](https://en.angie.software//angie/docs/installation/thirdparty.md#thirdparty).
# https://en.angie.software/angie/docs/installation/oss_packages.md
# Package Installation of Angie
To install and update Angie
using your distribution's package manager,
add and configure the appropriate repository.
## Distributions
| Name | Versions | Architectures |
|-----------------------------------|--------------------------------|-------------------------------|
| [AlmaLinux](#install-yum-oss) | 10, 9, 8 | x86-64, arm64 |
| [Alpine](#install-alpine-oss) | 3.23, 3.22, 3.21 | x86-64, arm64 |
| [ALT](#install-alt-oss) | 11, 10 8 | x86-64, arm64 x86-64 |
| [Astra SE](#install-astrase-oss) | 4.7 1.8, 1.7 | arm64 x86-64 |
| [CentOS](#install-yum-oss) | 10, 9 | x86-64, arm64 |
| [Debian](#install-deb-oss) | 13, 12, 11 | x86-64, arm64 |
| [Fedora](#install-yum-oss) | 44, 43 | x86-64, arm64 |
| [FreeBSD](#install-freebsd-oss) | 15, 14 | x86-64, arm64 |
| [MSVSphere](#install-yum-oss) | 10, 9 8 | x86-64, arm64 x86-64 |
| [openSUSE](#install-opensuse-oss) | 16, 15 | x86-64, arm64 |
| [Oracle Linux](#install-yum-oss) | 10, 9, 8 | x86-64, arm64 |
| [OSNova](#install-osnova-oss) | 3.3.0, 2.13 | x86-64 |
| [RED OS](#install-yum-oss) | 8, 7 | x86-64, arm64 |
| [Rocky Linux](#install-yum-oss) | 10, 9, 8 | x86-64, arm64 |
| [ROSA](#install-yum-oss) | Chrome 13 Chrome 12 Fresh 12 | x86-64 x86-64, arm64 x86-64 |
| [SberLinux](#install-yum-oss) | 9 | x86-64 |
| [Ubuntu](#install-deb-oss) | 26.04, 24.04, 22.04 | x86-64, arm64 |
### Test Builds
We test and build code from our repository daily,
and these
[nightly builds](https://download.angie.software/angie-nightly/)
are suitable for exploring new features ahead of official releases.
The version of the nightly builds always corresponds to the upcoming release.
The naming and installation process is generally similar to what's shown below,
but instead of the path prefix `https://download.angie.software/angie/*`
use `https://download.angie.software/angie-nightly/*`.
### Alma, CentOS, Fedora, MSVSphere, Oracle, RED OS, Rocky, ROSA, SberLinux
1. To add the repo, create a file named
`/etc/yum.repos.d/angie.repo`
with the following contents:
Alma
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/almalinux/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
CentOS
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/centos/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
Fedora
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/fedora/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
MSVSphere
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/msvsphere/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
Oracle
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/oracle/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
RED OS
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/redos/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
Rocky
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/rocky/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
ROSA Chrome
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/rosa-chrome/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
priority=9
```
ROSA Fresh
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/rosa/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
priority=9
```
SberLinux
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/sberlinux/$releasever/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
priority=9
```
2. Install the Angie package:
```console
$ sudo yum install -y angie
$ # -- OR --
$ sudo dnf install -y angie
```
3. (*Optional*) Install any [extra](#install-extras-oss)
packages you need:
```console
$ sudo yum install -y
$ # -- OR --
$ sudo dnf install -y
```
4. Start the service:
```console
$ sudo systemctl start angie
```
5. To autostart Angie after server reboot:
```console
$ sudo systemctl enable angie
```
### Alpine
1. Install the prerequisites
for adding the Angie repo:
```console
$ sudo apk update
$ sudo apk add curl ca-certificates
```
2. Download the public key of the Angie repo
for package verification:
```console
$ sudo curl -o /etc/apk/keys/angie-signing.rsa \
https://angie.software/keys/angie-signing.rsa
```
3. Add the Angie repo:
```console
$ echo "https://download.angie.software/angie/alpine/v$(egrep -o \
'[0-9]+\.[0-9]+' /etc/alpine-release)/main" \
| sudo tee -a /etc/apk/repositories > /dev/null
```
4. Update the repo indexes:
```console
$ sudo apk update
```
5. Install the Angie package:
```console
$ sudo apk add angie
```
6. (*Optional*) Install any [extra](#install-extras-oss)
packages you need:
```console
$ sudo apk add
```
7. Start the service:
```console
$ sudo service angie start
```
8. To autostart Angie after server reboot:
```console
$ sudo rc-update add angie
```
### ALT
1. Create the `/etc/ssl/angie/` directory:
```console
$ sudo mkdir -p /etc/ssl/angie/
```
2. Install the prerequisites
for adding the Angie repo:
```console
$ sudo apt-get update
$ sudo apt-get install -y curl apt-https
```
3. Download the public key of the Angie repo
for package verification:
```console
$ sudo curl -o /etc/ssl/angie/angie-signing.gpg \
https://angie.software/keys/angie-signing.gpg
```
4. Import the downloaded key into the trusted key ring:
```console
$ sudo gpg --no-default-keyring \
--keyring /usr/lib/alt-gpgkeys/pubring.gpg --import /etc/ssl/angie/angie-signing.gpg
```
5. Save the key's signature:
```sh
$ echo 'simple-key "angie" {
Fingerprint "EB8EAF3D4EF1B1ECF34865A2617AB978CB849A76";
Name "Angie (Signing Key) ";
}' | sudo tee /etc/apt/vendors.list.d/angie.list > /dev/null
```
6. Add the Angie repo:
ALT 11
```console
$ echo "rpm [angie] https://download.angie.software/angie/altlinux/11/ $(uname -m) main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
ALT 10
```console
$ echo "rpm [angie] https://download.angie.software/angie/altlinux/10/ $(uname -m) main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
ALT SP 10
```console
$ echo "rpm [angie] https://download.angie.software/angie/altlinux-sp/10/ $(uname -m) main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
ALT SP 8
```console
$ echo "rpm [angie] https://download.angie.software/angie/altlinux-sp/8/ $(uname -m) main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
7. Update the repo indexes:
```console
$ sudo apt-get update
```
8. Install the Angie package:
```console
$ sudo apt-get install -y angie
```
9. (*Optional*) Install any [extra](#install-extras-oss)
packages you need:
```console
$ sudo apt-get install -y
```
10. Start the service:
```console
$ sudo systemctl start angie
```
11. To autostart Angie after server reboot:
```console
$ sudo systemctl enable angie
```
### Astra SE
1. Install the prerequisites
for adding the Angie repo:
```console
$ sudo apt-get update
$ sudo apt-get install -y ca-certificates curl lsb-release
```
2. Download the public key of the Angie repo
for package verification:
```console
$ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
https://angie.software/keys/angie-signing.gpg
```
3. Add the Angie repo:
```console
$ echo "deb https://download.angie.software/angie/astra-se/$(egrep -o \
'[0-9]+.[0-9]+' /etc/astra_version) unstable main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
4. Update the repo indexes:
```console
$ sudo apt-get update
```
5. (*Optional*) When running a Closed Software Environment
([CSE](https://wiki.astralinux.ru/pages/viewpage.action?pageId=41190634)),
install the key package
for Angie binary verification:
```console
$ sudo apt-get install -y angie-digsig-key
```
Update the CSE:
```console
$ sudo update-initramfs -uk all
```
Then **restart the server**:
```console
$ sudo shutdown -r now
```
6. Install the Angie package:
```console
$ sudo apt-get install -y angie
```
7. (*Optional*) Install any [extra](#install-extras-oss)
packages you need:
```console
$ sudo apt-get install -y
```
### Debian, Ubuntu
1. Install the prerequisites
for adding the Angie repo:
```console
$ sudo apt-get update
$ sudo apt-get install -y ca-certificates curl
```
2. Download the public key of the Angie repo
for package verification:
```console
$ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
https://angie.software/keys/angie-signing.gpg
```
3. Add the Angie repo:
```console
$ echo "deb https://download.angie.software/angie/$(. /etc/os-release && echo "$ID/$VERSION_ID $VERSION_CODENAME") main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
4. Update the repo indexes:
```console
$ sudo apt-get update
```
5. Install the Angie package:
```console
$ sudo apt-get install -y angie
```
6. (*Optional*) Install any [extra](#install-extras-oss)
packages you need:
```console
$ sudo apt-get install -y
```
### OSNova
1. Install the prerequisites
for adding the Angie repo:
```console
$ sudo apt-get update
$ sudo apt-get install -y ca-certificates curl
```
2. Download the public key of the Angie repo
for package verification:
```console
$ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
https://angie.software/keys/angie-signing.gpg
```
3. Add the Angie repo:
```console
$ echo "deb https://download.angie.software/angie/osnova/$(egrep -o \
'[0-9]*' /etc/osnova_version | head -1) \
$(. /etc/os-release && echo "$VERSION_CODENAME") main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
4. Update the repo indexes:
```console
$ sudo apt-get update
```
5. Install the Angie package:
```console
$ sudo apt-get install -y angie
```
6. (*Optional*) Install any [extra](#install-extras-oss)
packages you need:
```console
$ sudo apt-get install -y
```
### FreeBSD
1. To add the Angie repo, create the directories:
```console
$ sudo mkdir -p /usr/local/etc/pkg/angie/ /usr/local/etc/pkg/repos/
```
2. To configure the repo, create a file named
`/usr/local/etc/pkg/repos/angie.conf`
with the following contents:
```console
angie: {
url: "https://download.angie.software/angie/freebsd/${VERSION_MAJOR}/${ARCH}",
signature_type: "pubkey",
pubkey: "/usr/local/etc/pkg/angie/angie-signing.rsa",
enabled: yes
}
```
3. Download the public key of the Angie repo
for package verification:
```console
$ sudo curl -o /usr/local/etc/pkg/angie/angie-signing.rsa \
https://angie.software/keys/angie-signing.rsa
```
4. Update the repo indexes:
```console
$ sudo pkg update
```
5. Install the Angie package:
```console
$ sudo pkg install -r angie -y angie
```
6. (*Optional*) Install any [extra](#install-extras-oss)
packages you need:
```console
$ sudo pkg install -r angie -y
```
7. Start the service:
```console
$ sudo service angie start
```
8. To autostart Angie after server reboot:
```console
$ sudo sysrc angie_enable=YES
```
#### NOTE
Since the FreeBSD package manager may incorrectly determine the latest version,
use the following approach to update already installed packages:
```console
$ sudo pkg upgrade `pkg search -r angie angie-[0-9] | sort -Vr | head -1 | awk {'print $1'}`
```
### openSUSE
1. To add the repo, create a file named
`/etc/zypp/repos.d/angie.repo`
with the following contents:
```ini
[angie]
name=Angie repo
baseurl=https://download.angie.software/angie/opensuse/$releasever_major/
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
2. Update the repo indexes:
```console
$ sudo zypper refresh
```
3. Install the Angie package:
```console
$ sudo zypper install -y angie
```
4. (*Optional*) Install any [extra](#install-extras-oss)
packages you need:
```console
$ sudo zypper install -y
```
5. Start the service:
```console
$ sudo systemctl start angie
```
6. To autostart Angie after server reboot:
```console
$ sudo systemctl enable angie
```
## Extras
Besides the packages that provide the basic functionality,
we also publish a few extra packages,
both our own and built from curated third-party sources.
### Console Light Web Panel
Console Light is a lightweight web monitoring panel for Angie,
published as `angie-console-light` in our repos.
It is installed in the same way as the `angie` package in the steps above;
see the configuration steps in [Console Light Web Monitoring Panel](https://en.angie.software//angie/docs/configuration/monitoring.md#monitoring).
### Dynamic Modules
To extend the basic functionality of Angie,
you can add various dynamic modules.
Modules can be [built from source](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild)
against a corresponding version of Angie,
but it is easier to get them as ready-made packages from our repository:
| [angie-module-image-filter](https://en.angie.software//angie/docs/configuration/modules/http/http_image_filter.md#http-image-filter) | Adds transformations for JPEG, GIF, PNG, and WebP images. |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| angie-module-njs: [HTTP JS](https://en.angie.software//angie/docs/configuration/modules/external-modules/http_js.md#http-js), [Stream JS](https://en.angie.software//angie/docs/configuration/modules/external-modules/stream_js.md#stream-js) | Enables using njs (a JavaScript subset) in Angie configuration in the `http` and `stream` contexts, respectively. |
| [angie-module-perl](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl) | Enables writing `location` and variable handlers in Perl, and also invoking Perl from SSI. |
| [angie-module-wamr](https://en.angie.software//angie/docs/configuration/modules/wasm/wasm_wamr.md#wasm-wamr) | Enables integration with [WebAssembly Micro Runtime](https://github.com/bytecodealliance/wasm-micro-runtime) for executing WASM code. |
| [angie-module-wasm](https://en.angie.software//angie/docs/configuration/modules/wasm/index.md#wasm-core) | Adds core WASM support. |
| [angie-module-wasmtime](https://en.angie.software//angie/docs/configuration/modules/wasm/wasm_wasmtime.md#wasm-wasmtime) | Enables integration with the [Wasmtime](https://wasmtime.dev/) runtime for executing WASM code. |
| [angie-module-xslt](https://en.angie.software//angie/docs/configuration/modules/http/http_xslt.md#http-xslt) | Adds a filter to transform XML responses with XSLT stylesheets. |
To use an installed module in a [configuration](https://en.angie.software//angie/docs/configuration/configfile.md#configfile),
load it using the [load_module](https://en.angie.software//angie/docs/configuration/modules/core.md#load-module) directive in the `main` context:
```nginx
load_module modules/.so;
```
A wide range of [third-party modules](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules)
is also available.
# https://en.angie.software/angie/docs/installation/docker.md
# Angie Docker Images
To run Angie in a
[Docker](https://docs.docker.com/engine/reference/commandline/cli/) container,
use the images from our registry: `docker.angie.software`.
They are built based on our [binary packages](https://en.angie.software//angie/docs/installation/oss_packages.md#oss-packages)
and the official base images of several operating systems.
#### NOTE
These images can also be run with Docker-compatible
container engines such as Podman.
The recommended Podman version is 4.9.3 or higher.
#### NOTE
Also note the [Docker](https://en.angie.software//angie/docs/configuration/modules/http/http_docker.md#http-docker) module,
which implements dynamic updating of upstream server groups
based on Docker container labels.
## Minimal Images
- `angie:minimal`:
version 1.12.1 based on Alpine 3.22.
- `angie:-minimal`:
specified version based on Alpine 3.22.
These images include only the `angie` package.
## Templated Images
- `angie:templated`:
version 1.12.1 based on Alpine 3.22.
- `angie:-templated`:
specified version based on Alpine 3.22.
These images set the following environment variables:
```docker
ENV ANGIE_BINARY="angie"
ENV ANGIE_CONFIG_TEMPLATE="/etc/angie/angie.conf.t"
ENV ANGIE_ERROR_LOG_SEVERITY="notice"
ENV ANGIE_FEATURE_RELOAD="on"
ENV ANGIE_FEATURE_TEMPLATE="on"
ENV ANGIE_LOAD_MODULES=""
ENV ANGIE_PID_FILE="/run/angie/angie.pid"
ENV ANGIE_WORKER_CONNECTIONS="65536"
ENV ANGIE_WORKER_RLIMIT_NOFILE="65536"
```
These variables can be used to customize the container behavior:
- `ANGIE_BINARY`:
Allows running the [debug version](https://en.angie.software//angie/docs/troubleshooting.md#debug-logging).
- `ANGIE_ERROR_LOG_SEVERITY`:
Sets the severity level for entries in the main [error log](https://en.angie.software//angie/docs/configuration/processing.md#logging) file.
- `ANGIE_LOAD_MODULES`:
Loads one or more available modules (all modules are included in the image).
Specify a comma-separated list of modules without spaces.
- `ANGIE_PID_FILE`:
Sets an alternative location for the process identifier (PID) file.
- `ANGIE_FEATURE_TEMPLATE`:
Generates [Angie configuration](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) using the
[gomplate](https://docs.gomplate.ca/) tool at container startup. Parameters
used: `--input-dir /etc/angie/templates` and
`--output-dir /etc/angie`.
- `ANGIE_FEATURE_RELOAD`:
Enables handling of `SIGHUP`, `SIGQUIT`, and `SIGTERM`
signals.
These include the following
[packages](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules)
(if they were released for the [Angie version](https://en.angie.software//angie/docs/oss_changes.md#oss-changes)
that the image was built with):
### Package List
- `angie-console-light`
- `angie-module-auth-jwt`
- `angie-module-auth-ldap`
- `angie-module-auth-pam`
- `angie-module-auth-spnego`
- `angie-module-auth-totp`
- `angie-module-brotli`
- `angie-module-cache-purge`
- `angie-module-cgi`
- `angie-module-combined-upstreams`
- `angie-module-dav-ext`
- `angie-module-dynamic-limit-req`
- `angie-module-echo`
- `angie-module-enhanced-memcached`
- `angie-module-eval`
- `angie-module-geoip2`
- `angie-module-headers-more`
- `angie-module-http-auth-radius`
- `angie-module-image-filter`
- `angie-module-keyval`
- `angie-module-lua`
- `angie-module-modsecurity`
- `angie-module-ndk`
- `angie-module-njs`
- `angie-module-opentracing`
- `angie-module-otel`
- `angie-module-perl`
- `angie-module-postgres`
- `angie-module-redis2`
- `angie-module-rtmp`
- `angie-module-set-misc`
- `angie-module-subs`
- `angie-module-testcookie`
- `angie-module-unbrotli`
- `angie-module-upload`
- `angie-module-vod`
- `angie-module-vts`
- `angie-module-wasm`
- `angie-module-wasmtime`
- `angie-module-xslt`
- `angie-module-zip`
- `angie-module-zstd`
### Examples
The configuration used in templated images applies the variables
approximately as follows:
```none
...
{{- if has $modules "zstd"}}
# package: angie-module-zstd
load_module modules/ngx_http_zstd_filter_module.so;
load_module modules/ngx_http_zstd_static_module.so;
{{end}}
user angie;
worker_processes auto;
worker_rlimit_nofile {{.Env.ANGIE_WORKER_RLIMIT_NOFILE}};
error_log /var/log/angie/error.log {{.Env.ANGIE_ERROR_LOG_SEVERITY}};
pid {{.Env.ANGIE_PID_FILE}};
events {
worker_connections {{.Env.ANGIE_WORKER_CONNECTIONS}};
}
http {
include /etc/angie/mime.types;
default_type application/octet-stream;
log_format main ...
```
Running a container with shell access:
```console
$ docker run -it --pull always --rm --entrypoint=sh \
docker.angie.software/angie:templated
```
Run Angie with custom connection parameters and modules
(the command **angie -T** will output the complete configuration):
```console
$ docker run -it --rm -e ANGIE_WORKER_CONNECTIONS=4 \
-e ANGIE_LOAD_MODULES="auth-jwt,vod" \
docker.angie.software/angie:templated angie -T
```
Start a container with a specified name and additional modules:
```console
$ docker run -it --rm --name angie-test \
-e ANGIE_WORKER_CONNECTIONS=4 \
-e ANGIE_LOAD_MODULES="auth-jwt,vod" \
docker.angie.software/angie:templated
```
Reload the configuration of a running container:
```console
$ docker kill -s HUP angie-test
```
## Images with Extra Modules
- `angie:latest`:
version 1.12.1 based on Alpine 3.22.
- `angie:`,
`angie:-alpine`:
specified version based on Alpine 3.22.
- `angie:-debian`:
specified version based on Debian 13.
- `angie:-rocky`:
specified version based on Rocky Linux 9.
- `angie:-ubuntu`:
specified version based on Ubuntu 24.04 LTS.
These include the following
[packages](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules)
(if they were released for the [Angie version](https://en.angie.software//angie/docs/oss_changes.md#oss-changes)
that the image was built with):
### Package List
- `angie-console-light`
- `angie-module-auth-jwt`
- `angie-module-auth-ldap`
- `angie-module-auth-pam`
- `angie-module-auth-spnego`
- `angie-module-auth-totp`
- `angie-module-brotli`
- `angie-module-cache-purge`
- `angie-module-cgi`
- `angie-module-combined-upstreams`
- `angie-module-dav-ext`
- `angie-module-dynamic-limit-req`
- `angie-module-echo`
- `angie-module-enhanced-memcached`
- `angie-module-eval`
- `angie-module-geoip2`
- `angie-module-headers-more`
- `angie-module-http-auth-radius`
- `angie-module-image-filter`
- `angie-module-keyval`
- `angie-module-lua`
- `angie-module-modsecurity`
- `angie-module-ndk`
- `angie-module-njs`
- `angie-module-opentracing`
- `angie-module-otel`
- `angie-module-perl`
- `angie-module-postgres`
- `angie-module-redis2`
- `angie-module-rtmp`
- `angie-module-set-misc`
- `angie-module-subs`
- `angie-module-testcookie`
- `angie-module-unbrotli`
- `angie-module-upload`
- `angie-module-vod`
- `angie-module-vts`
- `angie-module-wasm`
- `angie-module-wasmtime`
- `angie-module-xslt`
- `angie-module-zip`
- `angie-module-zstd`
## Running
To start a container with Angie on port 8080,
providing read-only access to the static files directory `/var/www/`
and the configuration file `angie.conf` located in the current working directory:
```console
$ docker run --rm --name angie -v /var/www:/usr/share/angie/html:ro \
-v $(pwd)/angie.conf:/etc/angie/angie.conf:ro -p 8080:80 -d docker.angie.software/angie:latest
$ curl -I localhost:8080
HTTP/1.1 200 OK
Server: Angie/1.12.1
Date: Fri, 17 Jul 2026 10:42:54 GMT
Content-Type: text/html
Content-Length: 543
Last-Modified: Fri, 17 Jul 2026 09:12:23 GMT
Connection: keep-alive
ETag: "64c3ccc7-21f"
Accept-Ranges: bytes
```
Such configurations are suitable for local development and configuration.
When using the [ACME module](https://en.angie.software//angie/docs/configuration/acme.md#acme-config) to obtain certificates,
mount the certificate storage directory on a persistent volume so that issued
certificates survive container recreation. Otherwise, every recreated
container starts with empty storage and requests new certificates, which may
hit the CA's [rate limits](https://letsencrypt.org/docs/rate-limits/):
```console
$ docker run --rm --name angie -v angie-acme:/var/lib/angie/acme \
-v $(pwd)/angie.conf:/etc/angie/angie.conf:ro -p 80:80 -p 443:443 -d docker.angie.software/angie:latest
```
## Building Custom Images
You can also build your own image
based on a supported distribution,
adding the Angie layer from [packages](https://en.angie.software//angie/docs/installation/oss_packages.md#oss-packages)
or [source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild).
Examples of corresponding `Dockerfile` files:
```dockerfile
FROM debian:13
LABEL org.opencontainers.image.authors="Release Engineering Team "
ARG DEBIAN_FRONTEND=noninteractive
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
ca-certificates curl \
&& curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
https://angie.software/keys/angie-signing.gpg \
&& echo "deb https://download.angie.software/angie/$(. /etc/os-release && echo "$ID/$VERSION_ID $VERSION_CODENAME") main" \
> /etc/apt/sources.list.d/angie.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
angie angie-module-geoip2 angie-module-njs \
&& rm -Rf /var/lib/apt/lists \
/etc/apt/sources.list.d/angie.list \
/etc/apt/trusted.gpg.d/angie-signing.gpg \
&& ln -sf /dev/stdout /var/log/angie/access.log \
&& ln -sf /dev/stderr /var/log/angie/error.log
EXPOSE 80
CMD ["angie", "-g", "daemon off;"]
```
```dockerfile
FROM alpine:3.22
LABEL org.opencontainers.image.authors="Release Engineering Team "
RUN set -x \
&& apk add --no-cache ca-certificates curl \
&& curl -o /etc/apk/keys/angie-signing.rsa https://angie.software/keys/angie-signing.rsa \
&& echo "https://download.angie.software/angie/alpine/v$(egrep -o \
'[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
&& apk add --no-cache angie angie-module-geoip2 angie-module-njs \
&& rm /etc/apk/keys/angie-signing.rsa \
&& ln -sf /dev/stdout /var/log/angie/access.log \
&& ln -sf /dev/stderr /var/log/angie/error.log
EXPOSE 80
CMD ["angie", "-g", "daemon off;"]
```
To build a `myangie` image in the directory with such a `Dockerfile`
and start a container as shown above:
```console
$ docker build -t myangie .
$ docker run --rm --name myangie -v /var/www:/usr/share/angie/html:ro \
-v $(pwd)/angie.conf:/etc/angie/angie.conf:ro -p 8080:80 -d myangie
```
# https://en.angie.software/angie/docs/installation/sourcebuild.md
# Building Angie from Source
We recommend installing Angie from official pre-built
[packages](https://en.angie.software//angie/docs/installation/oss_packages.md#oss-packages).
However, if you still need your own build, make sure the prerequisites are in
place first.
#### NOTE
Building Angie requires a C compiler (**gcc** or **clang**)
and **make**, plus the PCRE2, zlib, and OpenSSL libraries.
Install the development packages provided by your distribution. On Debian
and Ubuntu:
```console
$ sudo apt install build-essential libpcre2-dev zlib1g-dev libssl-dev
```
On RHEL, Fedora, and derivatives:
```console
$ sudo dnf install gcc make pcre2-devel zlib-devel openssl-devel
```
Alternatively, build these libraries statically together with Angie using
the `--with-pcre=`, `--with-zlib=`, and
`--with-openssl=` options shown in the [Examples](#examples-2).
To build Angie from source:
1. Download the `.tar.gz` archive from
[our website](https://download.angie.software/files/):
```console
$ curl -O https://download.angie.software/files/angie-1.12.1.tar.gz
```
2. Unpack the archive and navigate to the source directory:
```console
$ tar -xpf angie-1.12.1.tar.gz
$ cd angie-1.12.1
```
3. To prepare the build, use the **./configure** script,
which determines the specific characteristics of the OS where the build occurs,
particularly the methods that Angie can use to handle connections.
After a successful run, the script creates a `Makefile`.
With the prerequisites installed, a minimal build needs no options:
```console
$ ./configure
```
Otherwise, review and set the required [build options](#configure)
for the modules and libraries you need (see the [Examples](#examples-2)):
```console
$ ./configure
```
4. When the `Makefile` is ready, build and install Angie:
```console
$ make
$ make install
```
## Default Builds and Official Packages
Without options, **./configure** prepares a minimal build: an HTTP
server with only the modules that are enabled by default. These include
Angie's own [API](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#http-api), [Metric](https://en.angie.software//angie/docs/configuration/modules/http/http_metric.md#http-metric),
[Prometheus](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#http-prometheus), [DoH](https://en.angie.software//angie/docs/configuration/modules/http/http_doh.md#http-doh), and [Docker](https://en.angie.software//angie/docs/configuration/modules/http/http_docker.md#http-docker) modules, the proxying modules, and the standard load-balancing
methods. The full default set is exactly what the tables in [Enabling
and Disabling Modules](#enabling-and-disabling-modules) list with
`--without-` options; everything listed there with a `--with-`
option stays out unless you enable it.
Official Angie [packages](https://en.angie.software//angie/docs/installation/oss_packages.md#oss-packages) and Docker images add the
following optional modules and features on top of these defaults:
- HTTP: [SSL](https://en.angie.software//angie/docs/configuration/modules/http/http_ssl.md#http-ssl) with [HTTP/2](https://en.angie.software//angie/docs/configuration/modules/http/http_v2.md#http-v2) and [HTTP/3](https://en.angie.software//angie/docs/configuration/modules/http/http_v3.md#http-v3), [ACME](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#http-acme), [Addition](https://en.angie.software//angie/docs/configuration/modules/http/http_addition.md#http-addition),
[Auth Request](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#http-auth-request), [DAV](https://en.angie.software//angie/docs/configuration/modules/http/http_dav.md#http-dav), [FLV](https://en.angie.software//angie/docs/configuration/modules/http/http_flv.md#http-flv), [GunZIP](https://en.angie.software//angie/docs/configuration/modules/http/http_gunzip.md#http-gunzip), [Gzip Static](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip_static.md#http-gzip-static), [MP4](https://en.angie.software//angie/docs/configuration/modules/http/http_mp4.md#http-mp4), [Random Index](https://en.angie.software//angie/docs/configuration/modules/http/http_random_index.md#http-random-index), [RealIP](https://en.angie.software//angie/docs/configuration/modules/http/http_realip.md#http-realip), [Secure Link](https://en.angie.software//angie/docs/configuration/modules/http/http_secure_link.md#http-secure-link), [Slice](https://en.angie.software//angie/docs/configuration/modules/http/http_slice.md#http-slice), [Stub Status](https://en.angie.software//angie/docs/configuration/modules/http/http_stub_status.md#http-stub-status), and [Sub](https://en.angie.software//angie/docs/configuration/modules/http/http_sub.md#http-sub)
- the [Stream](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#stream-core) server with [ACME](https://en.angie.software//angie/docs/configuration/modules/stream/stream_acme.md#stream-acme),
[MQTT Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_mqtt_preread.md#stream-mqtt-preread), [RDP Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_rdp_preread.md#stream-rdp-preread), [RealIP](https://en.angie.software//angie/docs/configuration/modules/stream/stream_realip.md#stream-realip), [SSL](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl.md#stream-ssl), and [SSL Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl_preread.md#stream-ssl-preread)
- the [Mail](https://en.angie.software//angie/docs/configuration/modules/mail/index.md#mail-core) server with [SSL](https://en.angie.software//angie/docs/configuration/modules/mail/mail_ssl.md#mail-ssl)
- [thread pools](https://en.angie.software//angie/docs/configuration/modules/core.md#thread-pool) and asynchronous [file I/O](https://en.angie.software//angie/docs/configuration/modules/http/index.md#aio)
A custom build that replaces a packaged one thus usually needs the matching
`--with-` options from this list; each module's reference page also
states whether our packages include it.
Angie PRO [packages](https://en.angie.software//angie/docs/installation/pro_packages.md#pro-packages) are built with the same set of
optional modules and additionally include active [health probes](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream_probe.md#http-upstream-probe) and [feedback](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-feedback)-based balancing for
both HTTP and stream upstreams, plus HTTP request [queues](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-queue).
Modules with heavy external dependencies, such as [XSLT](https://en.angie.software//angie/docs/configuration/modules/http/http_xslt.md#http-xslt),
[Image Filter](https://en.angie.software//angie/docs/configuration/modules/http/http_image_filter.md#http-image-filter), [Perl](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl), [njs](https://en.angie.software//angie/docs/configuration/modules/external-modules/http_js.md#http-js), and the [WebAssembly](https://en.angie.software//angie/docs/configuration/modules/wasm/index.md#wasm-core) family, aren't compiled
into official builds; we ship them as separate dynamic module packages,
listed for [Angie](https://en.angie.software//angie/docs/installation/oss_packages.md#install-dynamicmodules-oss) and [Angie PRO](https://en.angie.software//angie/docs/installation/pro_packages.md#install-dynamicmodules-pro). We also package a curated set of
[third-party modules](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules); check it before
building a third-party module yourself.
To see how an installed Angie was built, run `angie -V`; it prints the
exact **./configure** options of that build. `angie -M` lists
its modules, both built-in and loaded. Both options are described among the
[command-line options](https://en.angie.software//angie/docs/configuration/runtime.md#runtime-cli-options).
## Build Options
### General
| Option | Description | Default |
|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `--help` | Prints a help message. | |
| `--user=`name | Sets the name of an unprivileged user whose credentials will be used by worker processes. After installation, the name can always be changed in the `angie.conf` configuration file using the [user](https://en.angie.software//angie/docs/configuration/modules/core.md#user) directive. | `nobody` |
| `--group=`name | Sets the name of a group whose credentials will be used by worker processes. After installation, the name can always be changed in the `angie.conf` configuration file using the [user](https://en.angie.software//angie/docs/configuration/modules/core.md#user) directive. | `--user` setting |
| `--build=`name | Sets an optional name for the build. | |
| `--builddir=`path | Sets the build directory. | `objs` |
| `--feature-cache=`path | Specifies the directory for caching build artifacts. | If set without a path, `--builddir` setting is used |
### Paths
| Option | Description | Default |
|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| `--prefix=`path | Defines the directory that will store server files. This same directory will also be used for all relative paths set by **./configure** (except for paths to library sources) and in the `angie.conf` configuration file. | `/usr/local/angie` |
| `--sbin-path=`path | Sets the name of the Angie executable. This name is used only during installation. | `/sbin/angie` |
| `--modules-path=`path | Defines the directory where dynamic modules will be installed. | `/modules` |
| `--conf-path=`path | Sets the name of the `angie.conf` [configuration file](https://en.angie.software//angie/docs/configuration/configfile.md#configfile). If needed, you can always start Angie with a different configuration file using the `-c` [command-line option](https://en.angie.software//angie/docs/configuration/runtime.md#runtime-cli-options). | `/conf/angie.conf` |
| `--error-log-path=`path | Sets the name of the primary error, warning, and diagnostic log file. After installation, the file name can always be changed in the `angie.conf` configuration file using the [error_log](https://en.angie.software//angie/docs/configuration/modules/core.md#error-log) directive. | `/logs/error.log` |
| `--pid-path=`path | Sets the name of the `angie.pid` file that will store the process ID of the main process. After installation, the file name can always be changed in the `angie.conf` configuration file using the [pid](https://en.angie.software//angie/docs/configuration/modules/core.md#pid) directive. | `/logs/angie.pid` |
| `--lock-path=`path | Sets the prefix for lock file names. After installation, the value can always be changed in the `angie.conf` configuration file using the [lock_file](https://en.angie.software//angie/docs/configuration/modules/core.md#lock-file) directive. | `/logs/angie.lock` |
| `--http-acme-client-path=`path | Sets the directory to store certificates and keys for `server` blocks that have [acme](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#id1) directives defined. | `/acme_client` |
| `--http-log-path=`path | Sets the name of the primary request log file for the HTTP server. After installation, the file name can always be changed in the `angie.conf` configuration file using the [access_log](https://en.angie.software//angie/docs/configuration/modules/http/http_log.md#access-log) directive. | `/logs/access.log` |
| `--http-client-body-temp-path=`path | Defines the directory for storing temporary files that hold client request bodies. After installation, the directory can always be changed in the `angie.conf` configuration file using the [client_body_temp_path](https://en.angie.software//angie/docs/configuration/modules/http/index.md#client-body-temp-path) directive. | `/client_body_temp` |
| `--http-proxy-temp-path=`path | Defines the directory for storing temporary files with data received from proxied servers. After installation, the directory can always be changed in the `angie.conf` configuration file using the [proxy_temp_path](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-temp-path) directive. | `/proxy_temp` |
| `--http-fastcgi-temp-path=`path | Defines the directory for storing temporary files with data received from FastCGI servers. After installation, the directory can always be changed in the `angie.conf` configuration file using the [fastcgi_temp_path](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-temp-path) directive. | `/fastcgi_temp` |
| `--http-uwsgi-temp-path=`path | Defines the directory for storing temporary files with data received from uWSGI servers. After installation, the directory can always be changed in the `angie.conf` configuration file using the [uwsgi_temp_path](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#uwsgi-temp-path) directive. | `/uwsgi_temp` |
| `--http-scgi-temp-path=`path | Defines the directory for storing temporary files with data received from SCGI servers. After installation, the directory can always be changed in the `angie.conf` configuration file using the [scgi_temp_path](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#scgi-temp-path) directive. | `/scgi_temp` |
### Features and dependencies
| `--with-select_module`, `--without-select_module` | Enables or disables building a module that allows the server to work with the `select()` method. This module is built automatically if the platform does not appear to support more appropriate methods such as `kqueue`, `epoll`, or `/dev/poll`. |
|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--with-poll_module`, `--without-poll_module` | Enables or disables building a module that allows the server to work with the `poll()` method. This module is built automatically if the platform does not appear to support more appropriate methods such as `kqueue`, `epoll`, or `/dev/poll`. |
| `--with-threads` | Enables the use of [thread pools](https://en.angie.software//angie/docs/configuration/modules/core.md#thread-pool) (`aio threads` mode). |
| `--with-file-aio` | Enables the use of [asynchronous file I/O](https://en.angie.software//angie/docs/configuration/modules/http/index.md#aio) (AIO) on FreeBSD and Linux (`aio on` mode). |
| `--with-debug` | Enables the [debugging log](https://en.angie.software//angie/docs/troubleshooting.md#debug-logging). |
| `--without-http-cache` | Disables the HTTP cache. |
| `--with-pcre`, `--with-pcre=`path | Enables the use of the PCRE library.
The optional parameter sets the path to the sources of the PCRE library. The library distribution needs to be downloaded from the [PCRE](http://www.pcre.org/) site and extracted. The rest is done by Angie's **./configure** and **make** commands.
The library is **required** for regular expression support in the `location` directive and for the [Rewrite](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#http-rewrite) module. |
| `--with-pcre-opt=`parameters | Sets additional build parameters for PCRE. |
| `--with-pcre-jit` | Builds the PCRE library with JIT compilation support (the [pcre_jit](https://en.angie.software//angie/docs/configuration/modules/core.md#pcre-jit) directive). |
| `--without-pcre` | Disables the use of the PCRE library. |
| `--without-pcre2` | Disables the use of the PCRE2 library instead of the original PCRE library. |
| `--with-libatomic`, `--with-libatomic=`path | Enables building with the **libatomic_ops** library. The optional parameter sets the path to the library sources. |
| `--with-openssl=`path | Enables static building and sets the path to the OpenSSL library sources. AWS-LC can be used as an OpenSSL-compatible library. |
| `--with-openssl-opt=`parameters | Sets additional build parameters for OpenSSL. |
| `--with-ntls` | Enables NTLS support in the HTTP module ([server-side](https://en.angie.software//angie/docs/configuration/modules/http/http_ssl.md#ssl-ntls), [client-side](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-ssl-ntls)) and stream module ([server-side](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl.md#s-ssl-ntls), [client-side](https://en.angie.software//angie/docs/configuration/modules/stream/stream_proxy.md#s-proxy-ssl-ntls)) when building with an SSL library that supports NTLS. |
| `--with-zlib=`path | Sets the path to the sources of the zlib library. The library distribution (version 1.1.3 or later) needs to be downloaded from the [zlib site](https://zlib.net/) and extracted; releases older than the current one are archived under [zlib fossils](https://zlib.net/fossils/). The rest is done by Angie's **./configure** and **make** commands.
The library is **required** for the [GZip](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip.md#http-gzip) module. |
| `--with-zlib-opt=`parameters | Sets additional build parameters for zlib. |
| `--with-zlib-asm=`cpu | Enables the use of assembly optimizations for building zlib, optimized for one of the following processors: `pentium`, `pentiumpro`. |
### Enabling and Disabling Modules
You can disable modules that are enabled by default, or enable modules
that are available but disabled by default. The `--with-` and
`--without-` tables below reflect the defaults of a bare
**./configure** run; the exact set that official packages enable is
listed in [Default Builds and Official Packages](#install-source-defaults).
#### HTTP
Enabling additional modules:
| `--with-http_acme_module` | Enables building the [ACME](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#http-acme) module, which enables the ACME protocol. |
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--with-http_addition_module` | Enables building the [Addition](https://en.angie.software//angie/docs/configuration/modules/http/http_addition.md#http-addition) module that allows adding text before and after a response. |
| `--with-http_auth_request_module` | Enables building the [Auth Request](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#http-auth-request) module that provides client authorization capability based on the result of a subrequest. |
| `--with-http_dav_module` | Enables building the [DAV](https://en.angie.software//angie/docs/configuration/modules/http/http_dav.md#http-dav) module intended for automating file management tasks on the server via the WebDAV protocol. |
| `--with-http_degradation_module` | Enables building the Degradation module that allows returning HTTP status codes 204 or 444 for certain `location` blocks.
This module can only be used in cases where `sbrk(0)` shows the actual amount of memory allocated to the process. In other words, the module works on FreeBSD up to version 7.0 by default. Starting from version 7.0, it works only if `MALLOC_OPTIONS=Dm` is set. On Linux it does not work. |
| `--with-http_flv_module` | Enables building the [FLV](https://en.angie.software//angie/docs/configuration/modules/http/http_flv.md#http-flv) module that provides server-side pseudo-streaming support for Flash Video (FLV) files. |
| `--with-http_geoip_module`, `--with-http_geoip_module=dynamic` | Enables building the [GeoIP](https://en.angie.software//angie/docs/configuration/modules/http/http_geoip.md#http-geoip) module that creates variables whose values are determined based on the client's IP address and ready-made [MaxMind](http://www.maxmind.com/) databases. |
| `--with-http_gunzip_module` | Enables building the [GunZIP](https://en.angie.software//angie/docs/configuration/modules/http/http_gunzip.md#http-gunzip) module that allows decompressing responses with `Content-Encoding: gzip` for clients that do not support the `gzip` compression method. |
| `--with-http_gzip_static_module` | Enables building the [GZip Static](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip_static.md#http-gzip-static) module that allows serving a precompressed file with the same name and the `.gz` extension instead of a regular file. |
| `--with-http_image_filter_module`, `--with-http_image_filter_module=dynamic` | Enables building the [Image Filter](https://en.angie.software//angie/docs/configuration/modules/http/http_image_filter.md#http-image-filter) module that allows transforming images in JPEG, GIF, PNG, and WebP formats. |
| `--with-http_mp4_module` | Enables building the [MP4](https://en.angie.software//angie/docs/configuration/modules/http/http_mp4.md#http-mp4) module that provides server-side pseudo-streaming support for MP4 format files. |
| `--with-http_perl_module`, `--with-http_perl_module=dynamic` | Enables building the [Perl](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl) module. |
| `--with-perl_modules_path=`path | Sets the directory where Perl module files will be located. |
| `--with-perl=`path | Sets the name of the Perl executable file. |
| `--with-http_random_index_module` | Enables building the [Random Index](https://en.angie.software//angie/docs/configuration/modules/http/http_random_index.md#http-random-index) module that serves requests ending with a slash (`/`) and returns a random file as the directory's index file. |
| `--with-http_realip_module` | Enables building the [RealIP](https://en.angie.software//angie/docs/configuration/modules/http/http_realip.md#http-realip) module that allows changing the client address to the one passed in the specified header field. |
| `--with-http_secure_link_module` | Enables building the [Secure Link](https://en.angie.software//angie/docs/configuration/modules/http/http_secure_link.md#http-secure-link) module. |
| `--with-http_slice_module` | Enables building the [Slice](https://en.angie.software//angie/docs/configuration/modules/http/http_slice.md#http-slice) module that allows splitting a request into subrequests, each returning a specific range of the response. The module provides efficient caching of large responses. |
| `--with-http_ssl_module` | Enables [SSL](https://en.angie.software//angie/docs/configuration/modules/http/http_ssl.md#http-ssl) support for the HTTP server.
The OpenSSL library is **required** for this module. |
| `--with-http_stub_status_module` | Enables building the [Stub Status](https://en.angie.software//angie/docs/configuration/modules/http/http_stub_status.md#http-stub-status) module that provides access to basic server status information. |
| `--with-http_sub_module` | Enables building the [Sub](https://en.angie.software//angie/docs/configuration/modules/http/http_sub.md#http-sub) module that allows modifying one specified string in the response to another. |
| `--with-http_v2_module` | Enables the [HTTP/2](https://en.angie.software//angie/docs/configuration/modules/http/http_v2.md#http-v2) module. |
| `--with-http_v3_module` | Enables the [HTTP/3](https://en.angie.software//angie/docs/configuration/modules/http/http_v3.md#http-v3) module. |
#### NOTE
For building, it is **strongly recommended** to use an SSL library
that supports the [QUIC](https://www.rfc-editor.org/rfc/rfc9000.html) protocol:
BoringSSL
Building with [BoringSSL](https://boringssl.googlesource.com/boringssl):
```console
$ ./configure \
--with-debug \
--with-http_v3_module \
--with-cc-opt="-I../boringssl/include" \
--with-ld-opt="-L../boringssl/build/ssl -L../boringssl/build/crypto"
```
LibreSSL
Building with [LibreSSL](https://www.libressl.org/):
```console
$ ./configure \
--with-debug \
--with-http_v3_module \
--with-cc-opt="-I../libressl/build/include" \
--with-ld-opt="-L../libressl/build/lib"
```
QuicTLS
Building with [QuicTLS](https://github.com/quictls/openssl):
```console
$ ./configure \
--with-debug \
--with-http_v3_module \
--with-cc-opt="-I../quictls/build/include" \
--with-ld-opt="-L../quictls/build/lib"
```
Without this, the [OpenSSL](https://openssl.org/) library will be used in compatibility mode, where
[early data](https://datatracker.ietf.org/doc/html/rfc8446#section-2.3) sending is not
supported and other features are missing, such as session reuse. Such a
build will be able to interact **only** with clients and servers
using OpenSSL in the same mode.
This fallback is silent: if the configured SSL library is missing or
unusable, **./configure** uses the system OpenSSL instead of
reporting an error. After it finishes, check the `Configuration
summary`: a line reading `+ using system OpenSSL library` means the
intended QUIC-capable library was not picked up.
| `--with-http_xslt_module`, `--with-http_xslt_module=dynamic` | Enables building the [XSLT](https://en.angie.software//angie/docs/configuration/modules/http/http_xslt.md#http-xslt) module that allows transforming XML responses using XSLT stylesheets.
The **libxml2** and **libxslt** libraries are **required** for this module. |
|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--with-google_perftools_module` | Enables building the [Google PerfTools](https://en.angie.software//angie/docs/configuration/modules/google_perftools.md#google-perftools) module that provides support for profiling Angie worker processes using [Google Performance Tools](https://github.com/gperftools/gperftools). The module is intended for Angie developers. |
Disabling standard modules:
| `--without-http` | Disables the [HTTP](https://en.angie.software//angie/docs/configuration/modules/http/index.md#http-core) server. |
|---------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--without-http_access_module` | Disables building the [Access](https://en.angie.software//angie/docs/configuration/modules/http/http_access.md#http-access) module that allows limiting access to certain client addresses. |
| `--without-http_api_module` | Disables building the [API](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#http-api) module that provides a RESTful HTTP interface for accessing JSON-based information about the web server instance. |
| `--without-http_metric_module` | Disables building the [Metric](https://en.angie.software//angie/docs/configuration/modules/http/http_metric.md#http-metric) module. |
| `--without-http_auth_basic_module` | Disables building the [Auth Basic](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_basic.md#http-auth-basic) module that allows limiting access to resources by validating the user name and password using the HTTP Basic Authentication protocol. |
| `--without-http_autoindex_module` | Disables building the [AutoIndex](https://en.angie.software//angie/docs/configuration/modules/http/http_autoindex.md#http-autoindex) module that processes requests ending with the slash character (`/`) and produces a directory listing in case the [Index](https://en.angie.software//angie/docs/configuration/modules/http/http_index.md#http-index) module cannot find an index file. |
| `--without-http_browser_module` | Disables building the [Browser](https://en.angie.software//angie/docs/configuration/modules/http/http_browser.md#http-browser) module that creates variables whose values depend on the value of the `User-Agent` request header field. |
| `--without-http_charset_module` | Disables building the [Charset](https://en.angie.software//angie/docs/configuration/modules/http/http_charset.md#http-charset) module that adds the specified charset to the `Content-Type` response header field and can additionally convert data from one charset to another. |
| `--without-http_doh_module` | Disables building the [DoH](https://en.angie.software//angie/docs/configuration/modules/http/http_doh.md#http-doh) module that implements a DNS over HTTPS server. |
| `--without-http_empty_gif_module` | Disables building the [Empty GIF](https://en.angie.software//angie/docs/configuration/modules/http/http_empty_gif.md#http-empty-gif) module that emits a single-pixel transparent GIF. |
| `--without-http_fastcgi_module` | Disables building the [FastCGI](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#http-fastcgi) module that passes requests to a FastCGI server. |
| `--without-http_geo_module` | Disables building the [Geo](https://en.angie.software//angie/docs/configuration/modules/http/http_geo.md#http-geo) module that creates variables with values depending on the client IP address. |
| `--without-http_gzip_module` | Disables building the [GZip](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip.md#http-gzip) module that compresses the HTTP server responses.
The zlib library is **required** for this module. |
| `--without-http_grpc_module` | Disables building the [gRPC](https://en.angie.software//angie/docs/configuration/modules/http/http_grpc.md#http-grpc) module that passes requests to a gRPC server. |
| `--without-http_limit_conn_module` | Disables building the [Limit Conn](https://en.angie.software//angie/docs/configuration/modules/http/http_limit_conn.md#http-limit-conn) module that limits the number of connections per key, for example, the number of connections from a single IP address. |
| `--without-http_limit_req_module` | Disables building the [Limit Req](https://en.angie.software//angie/docs/configuration/modules/http/http_limit_req.md#http-limit-req) module that limits the request processing rate per key, for example, the processing rate of requests coming from a single IP address. |
| `--without-http_map_module` | Disables building the [Map](https://en.angie.software//angie/docs/configuration/modules/http/http_map.md#http-map) module that creates variables with values depending on the values of other variables. |
| `--without-http_memcached_module` | Disables building the [Memcached](https://en.angie.software//angie/docs/configuration/modules/http/http_memcached.md#http-memcached) module that obtains responses from a memcached server. |
| `--without-http_mirror_module` | Disables building the [Mirror](https://en.angie.software//angie/docs/configuration/modules/http/http_mirror.md#http-mirror) module that implements mirroring of an original request by creating background mirror subrequests. |
| `--without-http_prometheus_module` | Disables building the [Prometheus](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#http-prometheus) module for the HTTP server. |
| `--without-http_proxy_module` | Disables building the [Proxy](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#http-proxy) module for the HTTP server. |
| `--without-http_referer_module` | Disables building the [Referer](https://en.angie.software//angie/docs/configuration/modules/http/http_referer.md#http-referer) module that can block access to a site for requests with invalid values in the `Referer` header field. |
| `--without-http_rewrite_module` | Disables building the [Rewrite](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#http-rewrite) module that allows the HTTP server to redirect requests and change their URIs.
The PCRE library is **required** for this module. |
| `--without-http_scgi_module` | Disables building the [SCGI](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#http-scgi) module that passes requests to an SCGI server. |
| `--without-http_split_clients_module` | Disables building the [Split Clients](https://en.angie.software//angie/docs/configuration/modules/http/http_split_clients.md#http-split-clients) module that creates variables for A/B testing. |
| `--without-http_ssi_module` | Disables building the [SSI](https://en.angie.software//angie/docs/configuration/modules/http/http_ssi.md#http-ssi) module that processes SSI (Server Side Includes) commands in responses passing through it. |
| `--without-http_upstream_hash_module` | Disables building the module that implements the [hash](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-hash) load balancing method. |
| `--without-http_upstream_ip_hash_module` | Disables building the module that implements the [ip_hash](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-ip-hash) load balancing method. |
| `--without-http_upstream_keepalive_module` | Disables building the module that provides [connection caching](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-keepalive) to upstream servers. |
| `--without-http_upstream_least_conn_module` | Disables building the module that implements the [least_conn](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-least-conn) load balancing method. |
| `--without-http_upstream_least_time_module` | Disables building the module that implements the [least_time](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-least-time) load balancing method. |
| `--without-http_upstream_random_module` | Disables building the module that implements the [random](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-random) load balancing method. |
| `--without-http_upstream_sticky_module` | Disables building the module that implements [session persistence](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-sticky), ensuring all requests in the client session are passed to the same server in the upstream. |
| `--without-http_upstream_zone_module` | Disables building the module that allows storing the run-time state of an upstream in a [shared memory zone](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-zone). |
| `--without-http_userid_module` | Disables building the [UserID](https://en.angie.software//angie/docs/configuration/modules/http/http_userid.md#http-userid) module that sets cookies suitable for client identification. |
| `--without-http_uwsgi_module` | Disables building the [uWSGI](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#http-uwsgi) module that passes requests to a uWSGI server. |
#### Stream modules
Enabling additional modules:
#### \* - `--with-stream`, `--with-stream=dynamic` - Enables the core [Stream](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#stream-core) module for generic TCP/UDP proxying and load balancing.
| `--with-stream_acme_module` | Enables building the [ACME](https://en.angie.software//angie/docs/configuration/modules/stream/stream_acme.md#stream-acme) module, which enables the ACME protocol. |
|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--with-stream_geoip_module`, `--with-stream_geoip_module=dynamic` | Enables the [GeoIP](https://en.angie.software//angie/docs/configuration/modules/stream/stream_geoip.md#stream-geoip) module that creates variables depending on the client IP address and the precompiled [MaxMind](http://www.maxmind.com/) databases. |
| `--with-stream_mqtt_preread_module` | Enables the [MQTT Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_mqtt_preread.md#stream-mqtt-preread) module that allows extracting client IDs and usernames from `CONNECT` packets in MQTT versions [3.1.1](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718028) and [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901033). |
| `--with-stream_rdp_preread_module` | Enables the [RDP Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_rdp_preread.md#stream-rdp-preread) module that allows extracting cookies from RDP sessions. |
| `--with-stream_realip_module` | Enables the [RealIP](https://en.angie.software//angie/docs/configuration/modules/stream/stream_realip.md#stream-realip) module that changes the client address to the address sent in the PROXY protocol header. |
| `--with-stream_ssl_module` | Enables [SSL](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl.md#stream-ssl) support for the Stream server.
The OpenSSL library is **required** to build and run this module. |
| `--with-stream_ssl_preread_module` | Enables the [SSL Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl_preread.md#stream-ssl-preread) module that allows extracting information from [ClientHello](https://datatracker.ietf.org/doc/html/rfc5246#section-7.4.1.2) messages without terminating SSL/TLS. |
Disabling standard modules:
#### \* - `--without-stream_access_module` - Disables the [Access](https://en.angie.software//angie/docs/configuration/modules/stream/stream_access.md#stream-access) module that allows limiting access to certain client addresses.
| `--without-stream_geo_module` | Disables the [Geo](https://en.angie.software//angie/docs/configuration/modules/stream/stream_geo.md#stream-geo) module that creates variables with values depending on the client IP address. |
|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--without-stream_limit_conn_module` | Disables the [Limit Conn](https://en.angie.software//angie/docs/configuration/modules/stream/stream_limit_conn.md#stream-limit-conn) module that limits the number of connections per key, for example, the number of connections from a single IP address. |
| `--without-stream_map_module` | Disables the [Map](https://en.angie.software//angie/docs/configuration/modules/stream/stream_map.md#stream-map) module that creates variables with values depending on values of other variables. |
| `--without-stream_return_module` | Disables the [Return](https://en.angie.software//angie/docs/configuration/modules/stream/stream_return.md#stream-return) module that sends the specified value to the client and then closes the connection. |
| `--without-stream_set_module` | Disables the [Set](https://en.angie.software//angie/docs/configuration/modules/stream/stream_set.md#stream-set) module that sets a value for a variable. |
| `--without-stream_split_clients_module` | Disables the [Split Clients](https://en.angie.software//angie/docs/configuration/modules/stream/stream_split_clients.md#stream-split-clients) module that creates variables for A/B testing. |
| `--without-stream_upstream_hash_module` | Disables the module that implements the [hash](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-hash) load balancing method. |
| `--without-stream_upstream_least_conn_module` | Disables the module that implements the [least_conn](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-least-conn) load balancing method. |
| `--without-stream_upstream_least_time_module` | Disables the module that implements the [least_time](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-least-time) load balancing method. |
| `--without-stream_upstream_random_module` | Disables the module that implements the [random](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-random) load balancing method. |
| `--without-stream_upstream_sticky_module` | Disables the module that implements [session persistence](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-sticky), ensuring all requests in the client session are passed to the same server in the upstream. |
| `--without-stream_upstream_zone_module` | Disables the module that enables storing the run-time state of an upstream in a [shared memory zone](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-zone). |
#### Mail
Enabling additional modules:
#### \* - `--with-mail`, `--with-mail=dynamic` - Enables the core [Mail](https://en.angie.software//angie/docs/configuration/modules/mail/index.md#mail-core) module that supports POP3, IMAP4, and SMTP.
| `--with-mail_ssl_module` | Enables [SSL](https://en.angie.software//angie/docs/configuration/modules/mail/mail_ssl.md#mail-ssl) support for the Mail server.
The OpenSSL library is **required** to build and run this module. |
|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Disabling standard modules:
#### \* - `--without-mail_imap_module` - Disables the [IMAP](https://en.angie.software//angie/docs/configuration/modules/mail/mail_imap.md#mail-imap) protocol in the Mail server.
| `--without-mail_pop3_module` | Disables the [POP3](https://en.angie.software//angie/docs/configuration/modules/mail/mail_pop3.md#mail-pop3) protocol in the Mail server. |
|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `--without-mail_smtp_module` | Disables the [SMTP](https://en.angie.software//angie/docs/configuration/modules/mail/mail_smtp.md#mail-smtp) protocol in the Mail server. |
#### Other options
#### \* - `--with-cpp_test_module` - Enables the CPP Test module. It's used primarily for development and testing purposes and isn't intended for production use.
| `--add-module=`path | Enables building an external module at the specified path. |
|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--add-dynamic-module=`path | Enables building an external dynamic module at the specified path. |
| `--with-compat` | Enables dynamic module compatibility mode. When enabled, Angie can load and use dynamic modules that were built for the same Angie version, even if these modules were built with different options. Angie PRO can load only modules built for Angie PRO; Angie (OSS) modules are rejected due to a different module signature. Official packages and images are built without this option. |
| `--with-cc=`path | Sets the compiler to be used during the build. |
| `--with-cpp=`path | Sets the preprocessor to be used during the build. |
| `--with-cc-opt=`parameters | Sets additional parameters that will be added to the `CFLAGS` variable. When using the system PCRE library under FreeBSD, `--with-cc-opt="-I /usr/local/include"` should be specified. If the number of files supported by `select()` needs to be increased, it can also be specified here, such as `--with-cc-opt="-D FD_SETSIZE=2048"`. |
| `--with-ld-opt=`parameters | Sets additional parameters that will be used during linking. When using the system PCRE library under FreeBSD, `--with-ld-opt="-L /usr/local/lib"` should be specified. |
| `--with-cpu-opt=`cpu | Enables builds optimized for one of the following processors: `pentium`, `pentiumpro`, `pentium3`, `pentium4`, `athlon`, `opteron`, `sparc32`, `sparc64`, `ppc64`. |
### Examples
**Simple HTTPS-Enabled Build**. This basic configuration enables HTTPS support
using SSL/TLS, with the necessary dependencies (PCRE for regular expressions,
zlib for compression, and OpenSSL for SSL/TLS):
```console
$ ./configure \
--sbin-path=/usr/sbin/angie \
--conf-path=/etc/angie/angie.conf \
--pid-path=/run/angie.pid \
--with-http_ssl_module \
--with-pcre=../pcre2-10.40 \
--with-zlib=../zlib-1.3 \
--with-openssl=../openssl-3.0.8
```
**Performance-Optimized Build**. This configuration is optimized for performance,
including HTTP/2 support, **gzip** static compression, JIT for PCRE, and
asynchronous I/O; thread pools are also enabled for efficient handling of high
loads:
```console
$ ./configure \
--sbin-path=/usr/sbin/angie \
--conf-path=/etc/angie/angie.conf \
--pid-path=/run/angie.pid \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_gzip_static_module \
--with-pcre=../pcre2-10.40 \
--with-pcre-jit \
--with-zlib=../zlib-1.3 \
--with-threads \
--with-file-aio
```
**Load Balancer with TCP/UDP Proxying**. This configuration sets up a load
balancer for both HTTP and non-HTTP services:
```console
$ ./configure \
--sbin-path=/usr/sbin/angie \
--conf-path=/etc/angie/angie.conf \
--pid-path=/run/angie.pid \
--with-stream \
--with-stream_ssl_module \
--with-pcre=../pcre2-10.40 \
--with-zlib=../zlib-1.3
```
**Specialized Build**. This configuration includes HTTPS, HTTP/2, compression,
enhanced security and performance, along with additional modules for Brotli
compression and cache management, optimized for both HTTP and TCP/UDP proxying:
```console
$ ./configure \
--prefix=/usr/local/angie \
--sbin-path=/usr/sbin/angie \
--conf-path=/etc/angie/angie.conf \
--pid-path=/run/angie.pid \
--lock-path=/var/lock/angie.lock \
--error-log-path=/var/log/angie/error.log \
--http-log-path=/var/log/angie/access.log \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-threads \
--with-file-aio \
--with-stream \
--with-stream_ssl_module \
--with-pcre=../pcre2-10.40 \
--with-pcre-jit \
--with-zlib=../zlib-1.3 \
--with-openssl=../openssl-3.0.8 \
--with-openssl-opt="enable-ec_nistp_64_gcc_128" \
--add-module=../ngx_brotli \
--add-dynamic-module=../ngx_cache_purge
```
The `--add-module` and `--add-dynamic-module` options above
reference third-party module sources that you download separately. For example,
clone them next to the Angie source tree:
```console
$ git clone --recurse-submodules https://github.com/google/ngx_brotli
$ git clone https://github.com/nginx-modules/ngx_cache_purge
```
See [Installing Third-Party Modules](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules) for the modules
Angie packages and their sources.
# https://en.angie.software/angie/docs/installation/pro_packages.md
# Package Installation of Angie PRO
To access the package repository,
you need to sign a contract and purchase a license.
For questions about licenses, contracts, and custom builds, contact:
- [info@wbsrv.ru](mailto:info@wbsrv.ru)
- [https://angie.software/](https://angie.software/)
- +7 (495) 120 50 33
Then, configure the repository for your distro's package manager
to install and update Angie PRO
and the [dynamic modules](#install-dynamicmodules-pro) you need.
Finally, install the [license file](#install-license)
and remove the restrictions.
## Distributions
| Name | Versions | Architectures |
|-----------------------------------|--------------------------------|-------------------------------|
| [AlmaLinux](#install-yum-pro) | 10, 9, 8 | x86-64, arm64 |
| [Alpine](#install-alpine-pro) | 3.23, 3.22, 3.21 | x86-64, arm64 |
| [ALT](#install-alt-pro) | 11, 10 8 | x86-64, arm64 x86-64 |
| [Astra SE](#install-astrase-pro) | 4.7 1.8, 1.7 | arm64 x86-64 |
| [CentOS](#install-yum-pro) | 10, 9 | x86-64, arm64 |
| [Debian](#install-deb-pro) | 13, 12, 11 | x86-64, arm64 |
| [Fedora](#install-yum-pro) | 44, 43 | x86-64, arm64 |
| [FreeBSD](#install-freebsd-pro) | 15, 14 | x86-64, arm64 |
| [MSVSphere](#install-yum-pro) | 10, 9 8 | x86-64, arm64 x86-64 |
| [openSUSE](#install-opensuse-pro) | 16, 15 | x86-64, arm64 |
| [Oracle Linux](#install-yum-pro) | 10, 9, 8 | x86-64, arm64 |
| [OSNova](#install-osnova-pro) | 3.3.0, 2.13 | x86-64 |
| [RED OS](#install-yum-pro) | 8, 7 | x86-64, arm64 |
| [Rocky Linux](#install-yum-pro) | 10, 9, 8 | x86-64, arm64 |
| [ROSA](#install-yum-pro) | Chrome 13 Chrome 12 Fresh 12 | x86-64 x86-64, arm64 x86-64 |
| [SberLinux](#install-yum-pro) | 9 | x86-64 |
| [Ubuntu](#install-deb-pro) | 26.04, 24.04, 22.04 | x86-64, arm64 |
### Alma, CentOS, Fedora, MSVSphere, Oracle, RED OS, Rocky, ROSA, SberLinux
1. Create the `/etc/ssl/angie/` directory:
```console
$ sudo mkdir -p /etc/ssl/angie/
```
2. Transfer the files you received with your license:
| File Type | Original Name | Where to Place |
|-------------|------------------|---------------------------------|
| Certificate | `angie-repo.crt` | `/etc/ssl/angie/angie-repo.crt` |
| Private Key | `angie-repo.key` | `/etc/ssl/angie/angie-repo.key` |
3. To add the repository,
create the file
`/etc/yum.repos.d/angie.repo`
with the following content:
Alma
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/almalinux/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
CentOS
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/centos/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
Fedora
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/fedora/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
MSVSphere
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/msvsphere/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
Oracle
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/oracle/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
RED OS
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/redos/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
Rocky
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/rocky/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
ROSA Chrome
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/rosa-chrome/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
ROSA Fresh
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/rosa/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
SberLinux
```ini
[angie-pro]
name=Angie PRO repo
baseurl=https://download.angie.software/angie-pro/sberlinux/$releasever/
sslclientcert=/etc/ssl/angie/angie-repo.crt
sslclientkey=/etc/ssl/angie/angie-repo.key
gpgcheck=1
enabled=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
4. Install the Angie PRO package:
```console
$ sudo yum install -y angie-pro
$ # -- OR --
$ sudo dnf install -y angie-pro
```
5. (*Optional*) Install any [extra](#install-extras-pro)
packages you need:
```console
$ sudo yum install -y
$ # -- OR --
$ sudo dnf install -y
```
6. Start the service:
```console
$ sudo systemctl start angie
```
7. To automatically start Angie PRO after server reboot:
```console
$ sudo systemctl enable angie
```
### Alpine
1. Transfer the files you received with your license:
| File Type | Original Name | Where to Place |
|-------------|------------------|---------------------|
| Certificate | `angie-repo.crt` | `/etc/apk/cert.pem` |
| Private Key | `angie-repo.key` | `/etc/apk/cert.key` |
2. Install the helper packages
for adding the Angie PRO repository:
```console
$ sudo apk update
$ sudo apk add curl ca-certificates
```
3. Download the public key of the Angie PRO repository
for package verification:
```console
$ sudo curl -o /etc/apk/keys/angie-signing.rsa \
https://angie.software/keys/angie-signing.rsa
```
4. Add the Angie PRO repository:
```console
$ echo "https://download.angie.software/angie-pro/alpine/v$(egrep -o \
'[0-9]+\.[0-9]+' /etc/alpine-release)/main" \
| sudo tee -a /etc/apk/repositories > /dev/null
```
5. Update the repository indexes:
```console
$ sudo apk update
```
6. Install the Angie PRO package:
```console
$ sudo apk add angie-pro
```
7. (*Optional*) Install any [extra](#install-extras-pro)
packages you need:
```console
$ sudo apk add
```
8. Start the service:
```console
$ sudo service angie start
```
9. To automatically start Angie PRO after server reboot:
```console
$ sudo rc-update add angie
```
### ALT
1. Create the `/etc/ssl/angie/` directory:
```console
$ sudo mkdir -p /etc/ssl/angie/
```
2. Transfer the files you received with your license:
| File Type | Original Name | Where to Place |
|-------------|------------------|---------------------------------|
| Certificate | `angie-repo.crt` | `/etc/ssl/angie/angie-repo.crt` |
| Private Key | `angie-repo.key` | `/etc/ssl/angie/angie-repo.key` |
3. Download the public key of the Angie PRO repository
for package verification:
```console
$ curl -o ~/angie-signing.gpg https://angie.software/keys/angie-signing.gpg && \
sudo gpg --no-default-keyring --keyring /usr/lib/alt-gpgkeys/pubring.gpg --import ~/angie-signing.gpg
```
4. Save the key signature:
```sh
$ echo 'simple-key "angie-pro" {
Fingerprint "EB8EAF3D4EF1B1ECF34865A2617AB978CB849A76";
Name "Angie PRO (Signing Key) ";
}' | sudo tee /etc/apt/vendors.list.d/angie.list > /dev/null
```
5. Add the Angie PRO repository:
ALT 11
```console
$ echo "rpm [angie-pro] https://download.angie.software/angie-pro/altlinux/11/ $(uname -m) main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
ALT 10
```console
$ echo "rpm [angie-pro] https://download.angie.software/angie-pro/altlinux/10/ $(uname -m) main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
ALT SP 10
```console
$ echo "rpm [angie-pro] https://download.angie.software/angie-pro/altlinux-sp/10/ $(uname -m) main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
ALT SP 8
```console
$ echo "rpm [angie-pro] https://download.angie.software/angie-pro/altlinux-sp/8/ $(uname -m) main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
6. Create the Angie PRO repository `apt` configuration file
in `/etc/apt/apt.conf.d`:
```console
$ ( echo 'Acquire::https::Verify-Peer "true";';
echo 'Acquire::https::Verify-Host "true";';
echo 'Acquire::https::SslCert "/etc/ssl/angie/angie-repo.crt";';
echo 'Acquire::https::SslKey "/etc/ssl/angie/angie-repo.key";';
) | sudo tee -a /etc/apt/apt.conf >/dev/null
```
7. Update the repository indexes:
```console
$ sudo apt-get update
```
8. Install the Angie PRO package:
```console
$ sudo apt-get install -y angie-pro
```
9. (*Optional*) Install any [extra](#install-extras-pro)
packages you need:
```console
$ sudo apt-get install -y
```
10. Start the service:
```console
$ sudo systemctl start angie
```
11. To automatically start Angie PRO after server reboot:
```console
$ sudo systemctl enable angie
```
### Astra SE
1. Create the `/etc/ssl/angie/` directory:
```console
$ sudo mkdir -p /etc/ssl/angie/
```
2. Transfer the files you received with your license:
| File Type | Original Name | Where to Place |
|-------------|------------------|---------------------------------|
| Certificate | `angie-repo.crt` | `/etc/ssl/angie/angie-repo.crt` |
| Private Key | `angie-repo.key` | `/etc/ssl/angie/angie-repo.key` |
Restrict access to the directory and files:
```console
$ sudo chown -R _apt:nogroup /etc/ssl/angie/
```
3. Install the helper packages
for adding the Angie PRO repository:
```console
$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https lsb-release \
ca-certificates curl gnupg2
```
4. Download the public key of the Angie PRO repository
for package verification:
```console
$ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
https://angie.software/keys/angie-signing.gpg
```
5. Add the Angie PRO repository:
```console
$ echo "deb https://download.angie.software/angie-pro/astra-se/$(egrep -o \
'[0-9]+\.[0-9]+' /etc/astra_version) unstable main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
6. To configure the repository, create a file
`/etc/apt/apt.conf.d/90download-angie`
with the following contents:
```console
Acquire::https::download.angie.software::Verify-Peer "true";
Acquire::https::download.angie.software::Verify-Host "true";
Acquire::https::download.angie.software::SslCert "/etc/ssl/angie/angie-repo.crt";
Acquire::https::download.angie.software::SslKey "/etc/ssl/angie/angie-repo.key";
```
7. Update the repository indexes:
```console
$ sudo apt-get update
```
8. (*Optional*) When running in Closed Software Environment mode
([CSE](https://wiki.astralinux.ru/pages/viewpage.action?pageId=41190634)),
install the key package for verifying the authenticity of
Angie PRO executable files:
```console
$ sudo apt-get install -y angie-digsig-key
```
Update the CSE:
```console
$ sudo update-initramfs -uk all
```
Then **restart the server**:
```console
$ sudo shutdown -r now
```
9. Install the Angie PRO package:
```console
$ sudo apt-get install -y angie-pro
```
10. (*Optional*) Install any [extra](#install-extras-pro)
packages you need:
```console
$ sudo apt-get install -y
```
### Debian, Ubuntu
1. Create the `/etc/ssl/angie/` directory:
```console
$ sudo mkdir -p /etc/ssl/angie/
```
2. Transfer the files you received with your license:
| File Type | Original Name | Where |
|-------------|------------------|---------------------------------|
| Certificate | `angie-repo.crt` | `/etc/ssl/angie/angie-repo.crt` |
| Private Key | `angie-repo.key` | `/etc/ssl/angie/angie-repo.key` |
Restrict access to the directory and files:
```console
$ sudo chown -R _apt:nogroup /etc/ssl/angie/
```
3. Install the prerequisites
for adding the Angie PRO repo:
```console
$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https lsb-release \
ca-certificates curl gnupg2
```
4. Download the public key of the Angie PRO repo
for package verification:
```console
$ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
https://angie.software/keys/angie-signing.gpg
```
5. Add the Angie PRO repo:
```console
$ echo "deb https://download.angie.software/angie-pro/$(. /etc/os-release && echo "$ID/$VERSION_ID $VERSION_CODENAME") main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
6. To configure the repo, create a file named
`/etc/apt/apt.conf.d/90download-angie`
with the following contents:
```console
Acquire::https::download.angie.software::Verify-Peer "true";
Acquire::https::download.angie.software::Verify-Host "true";
Acquire::https::download.angie.software::SslCert "/etc/ssl/angie/angie-repo.crt";
Acquire::https::download.angie.software::SslKey "/etc/ssl/angie/angie-repo.key";
```
7. Update the repo indexes:
```console
$ sudo apt-get update
```
8. Install the Angie PRO package:
```console
$ sudo apt-get install -y angie-pro
```
9. (*Optional*) Install any [extra](#install-extras-pro)
packages you need:
```console
$ sudo apt-get install -y
```
### OSNova
1. Install the prerequisites
for adding the Angie PRO repo:
```console
$ sudo apt-get update
$ sudo apt-get install -y ca-certificates curl
```
2. Download the public key of the Angie PRO repo
for package verification:
```console
$ sudo curl -o /etc/apt/trusted.gpg.d/angie-signing.gpg \
https://angie.software/keys/angie-signing.gpg
```
3. Add the Angie PRO repo:
```console
$ echo "deb https://download.angie.software/angie-pro/osnova/$(egrep -o \
'[0-9]*' /etc/osnova_version | head -1) \
$(. /etc/os-release && echo "$VERSION_CODENAME") main" \
| sudo tee /etc/apt/sources.list.d/angie.list > /dev/null
```
4. Update the repo indexes:
```console
$ sudo apt-get update
```
5. Install the Angie PRO package:
```console
$ sudo apt-get install -y angie
```
6. (*Optional*) Install any [extra](#install-extras-pro)
packages you need:
```console
$ sudo apt-get install -y
```
### FreeBSD
1. To add the Angie PRO repo, create these directories:
```console
$ sudo mkdir -p /usr/local/etc/pkg/angie/ /usr/local/etc/pkg/repos/
```
2. To configure the repo, create a file named
`/usr/local/etc/pkg/repos/angie.conf`
with the following contents:
```pkgconfig
angie: {
url: "https://download.angie.software/angie-pro/freebsd/${VERSION_MAJOR}/${ARCH}",
signature_type: "pubkey",
pubkey: "/usr/local/etc/pkg/angie/angie-signing.rsa",
enabled: yes
}
```
3. Download the public key of the Angie PRO repo
for package verification:
```console
$ sudo curl -o /usr/local/etc/pkg/angie/angie-signing.rsa \
https://angie.software/keys/angie-signing.rsa
```
4. Transfer the files you received with your license:
| File Type | Original Name | Where |
|-------------|------------------|-------------------------------------------|
| Certificate | `angie-repo.crt` | `/usr/local/etc/pkg/angie/angie-repo.crt` |
| Private Key | `angie-repo.key` | `/usr/local/etc/pkg/angie/angie-repo.key` |
5. Add the certificate and the key to the package manager's configuration:
```sh
$ echo '
PKG_ENV: {
SSL_CLIENT_CERT_FILE: "/usr/local/etc/pkg/angie/angie-repo.crt",
SSL_CLIENT_KEY_FILE: "/usr/local/etc/pkg/angie/angie-repo.key"
}' | sudo tee -a /usr/local/etc/pkg.conf > /dev/null
```
6. Update the repo indexes:
```console
$ sudo pkg update
```
7. Install the Angie PRO package:
```console
$ sudo pkg install -r angie -y angie-pro
```
8. (*Optional*) Install any [extra](#install-extras-pro)
packages you need:
```console
$ sudo pkg install -r angie -y
```
9. Start the service:
```console
$ sudo service angie start
```
10. To autostart Angie PRO after server reboot:
```console
$ sudo sysrc angie_enable=YES
```
#### NOTE
Since the FreeBSD package manager may incorrectly determine the latest version,
use the following approach to update already installed packages:
```console
$ sudo pkg upgrade `pkg search -r angie angie-pro-[0-9] | sort -Vr | head -1 | awk {'print $1'}`
```
### openSUSE
1. Create the `/etc/ssl/angie/` directory:
```console
$ sudo mkdir -p /etc/ssl/angie/
```
2. Transfer the files you received with your license:
| File Type | Original Name | Where |
|-------------|------------------|---------------------------------|
| Certificate | `angie-repo.crt` | `/etc/ssl/angie/angie-repo.crt` |
| Private Key | `angie-repo.key` | `/etc/ssl/angie/angie-repo.key` |
Then combine them into a bundle `/etc/ssl/angie/angie-repo-bundle.crt`:
```console
$ cat /etc/ssl/angie/angie-repo.crt /etc/ssl/angie/angie-repo.key | \
sudo tee -a /etc/ssl/angie/angie-repo-bundle.crt > /dev/null
```
3. To add the repository, create a file named
`/etc/zypp/repos.d/angie.repo`
with the following contents:
```ini
[angie-pro]
enabled=1
autorefresh=1
baseurl=https://download.angie.software/angie-pro/opensuse/$releasever_major?ssl_clientcert=/etc/ssl/angie/angie-repo-bundle.crt&ssl_verify=peer
gpgcheck=1
gpgkey=https://angie.software/keys/angie-signing.gpg.asc
```
4. Update the repo indexes:
```console
$ sudo zypper refresh
```
5. Install the Angie PRO package:
```console
$ sudo zypper install -y angie-pro
```
6. (*Optional*) Install any [extra](#install-extras-pro)
packages you need:
```console
$ sudo zypper install -y
```
7. Start the service:
```console
$ sudo systemctl start angie
```
8. To automatically start Angie PRO after server reboot:
```console
$ sudo systemctl enable angie
```
## Extras
In addition to packages that provide core functionality,
we also publish several additional packages,
both our own and from selected third-party sources.
### Console Light Web Panel
Console Light is a lightweight
[monitoring web panel](https://en.angie.software//angie/docs/configuration/monitoring.md#monitoring) for Angie PRO,
published in our repositories as the `angie-pro-console-light` package.
It's installed the same way as the `angie` package in the instructions above;
for configuration instructions, see the [Console Light Web Monitoring Panel](https://en.angie.software//angie/docs/configuration/monitoring.md#monitoring) section.
### Dynamic Modules
To extend the basic functionality of Angie PRO,
you can add various dynamic modules.
You can get them as ready-made packages from our repository:
| [angie-pro-module-image-filter](https://en.angie.software//angie/docs/configuration/modules/http/http_image_filter.md#http-image-filter) | Adds image transformations for JPEG, GIF, PNG, and WebP formats. |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| angie-pro-module-njs: [HTTP JS](https://en.angie.software//angie/docs/configuration/modules/external-modules/http_js.md#http-js), [Stream JS](https://en.angie.software//angie/docs/configuration/modules/external-modules/stream_js.md#stream-js) | Allow using the njs language (a subset of JavaScript) in Angie PRO configuration in `http` and `stream` contexts respectively. |
| [angie-pro-module-perl](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl) | Allows writing `location` and variable handlers in Perl, as well as calling Perl from SSI. |
| [angie-pro-module-xslt](https://en.angie.software//angie/docs/configuration/modules/http/http_xslt.md#http-xslt) | Adds a filter that transforms XML responses using XSLT templates. |
To apply an installed module in your [configuration](https://en.angie.software//angie/docs/configuration/configfile.md#configfile),
load it using the [load_module](https://en.angie.software//angie/docs/configuration/modules/core.md#load-module) directive in the `main` context:
```nginx
load_module modules/.so;
```
A wide range of [third-party modules](https://en.angie.software//angie/docs/installation/external-modules/index.md#install-thirdpartymodules) is also available.
## License File
To configure the license for Angie PRO:
1. Save the license file as `/etc/angie/license.pem`,
setting the same permissions you use for your
[client certificates](https://en.angie.software//angie/docs/configuration/ssl.md#ssl-config).
2. Verify the license is valid;
otherwise, check the details:
```console
$ sudo angie -t
angie: Valid license found:
angie: - owner: CN=Angie Client License
angie: - period: Jul 8 21:00:00 2024 GMT .. Jul 17 20:59:59 2024 GMT
angie:
angie: Limitations:
angie: - worker_processes_limit: 8
angie: - worker_connections_limit: 0
```
3. Monitor the console and logs for any licensing issues.
If the license expires during operation,
Angie PRO periodically issues corresponding warnings.
Additionally, on reload, configuration error messages will appear
if, for example, the number of worker processes
specified in the license terms is exceeded.
4. Modify the `/etc/angie/angie.conf` file;
after installation, two parameters in it limit operation:
```nginx
worker_processes 1;
worker_connections 256;
```
After saving the license file,
change them according to your license terms, for example:
```nginx
worker_processes 8;
worker_connections 65535;
```
# https://en.angie.software/angie/docs/installation/external-modules.md
# Installing Third-Party Modules
In addition to our own dynamic modules for
[Angie](https://en.angie.software//angie/docs/installation/oss_packages.md#install-dynamicmodules-oss) and [Angie PRO](https://en.angie.software//angie/docs/installation/pro_packages.md#install-dynamicmodules-pro),
we collect and publish packages for a number of popular nginx-compatible third-party modules,
developed outside our company, in our repository.
## Installation and Configuration
Third-party module packages are installed from our repository just like our own packages:
- [Angie](https://en.angie.software//angie/docs/installation/oss_packages.md#oss-packages)
- [Angie PRO](https://en.angie.software//angie/docs/installation/pro_packages.md#pro-packages)
To use the installed module in [configuration](https://en.angie.software//angie/docs/configuration/configfile.md#configfile),
load it using the [load_module](https://en.angie.software//angie/docs/configuration/modules/core.md#load-module) directive in the `main` context:
```nginx
load_module modules/.so;
```
#### NOTE
We do not review the source code of these modules
and are not responsible for the consequences of their installation;
the packages are compiled based on numerous requests
*exclusively* for user convenience.
## List of Packages
| Module | Version | Packages |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
| [Auth JWT](https://en.angie.software//angie/docs/configuration/modules/external-modules/auth-jwt.md#external-auth-jwt) | [0.14.2](https://github.com/kjdev/nginx-auth-jwt) | `angie-module-auth-jwt` `angie-pro-module-auth-jwt` |
| [Auth LDAP](https://en.angie.software//angie/docs/configuration/modules/external-modules/auth-ldap.md#external-ldap) | [241200e](https://github.com/kvspb/nginx-auth-ldap) | `angie-module-auth-ldap` `angie-pro-module-auth-ldap` |
| [Auth PAM](https://en.angie.software//angie/docs/configuration/modules/external-modules/auth-pam.md#external-auth-pam) | [v1.5.5](https://github.com/sto/ngx_http_auth_pam_module) | `angie-module-auth-pam` `angie-pro-module-auth-pam` |
| [Auth SPNEGO](https://en.angie.software//angie/docs/configuration/modules/external-modules/auth-spnego.md#external-auth-spnego) | [v1.1.3](https://github.com/stnoonan/spnego-http-auth-nginx-module) | `angie-module-auth-spnego` `angie-pro-module-auth-spnego` |
| [Auth TOTP](https://en.angie.software//angie/docs/configuration/modules/external-modules/auth-totp.md#external-auth-totp) | [1.2.0](https://github.com/61131/nginx-http-auth-totp) | `angie-module-auth-totp` `angie-pro-module-auth-totp` |
| [Brotli](https://en.angie.software//angie/docs/configuration/modules/external-modules/brotli.md#external-brotli) | [v1.0.0rc](https://github.com/google/ngx_brotli) | `angie-module-brotli` `angie-pro-module-brotli` |
| [Cache Purge](https://en.angie.software//angie/docs/configuration/modules/external-modules/cache-purge.md#external-cache-purge) | [3.0.2](https://github.com/nginx-modules/ngx_cache_purge) | `angie-module-cache-purge` `angie-pro-module-cache-purge` |
| [CGI](https://en.angie.software//angie/docs/configuration/modules/external-modules/cgi.md#external-cgi) | [v0.15](https://github.com/pjincz/nginx-cgi) | `angie-module-cgi` `angie-pro-module-cgi` |
| [Combined Upstreams](https://en.angie.software//angie/docs/configuration/modules/external-modules/combined-upstreams.md#external-combined-upstreams) | [2.3.1](https://github.com/lyokha/nginx-combined-upstreams-module) | `angie-module-combined-upstreams` `angie-pro-module-combined-upstreams` |
| [DAV Ext](https://en.angie.software//angie/docs/configuration/modules/external-modules/dav-ext.md#external-dav-ext) | [v4.0.1](https://github.com/arut/nginx-dav-ext-module) | `angie-module-dav-ext` `angie-pro-module-dav-ext` |
| [Dynamic Limit Req](https://en.angie.software//angie/docs/configuration/modules/external-modules/dynamic-limit-req.md#external-dynamic-limit-req) | [1.9.3](https://github.com/limithit/ngx_dynamic_limit_req_module) | `angie-module-dynamic-limit-req` `angie-pro-module-dynamic-limit-req` |
| [Echo](https://en.angie.software//angie/docs/configuration/modules/external-modules/echo.md#external-echo) | [v0.64](https://github.com/openresty/echo-nginx-module) | `angie-module-echo` `angie-pro-module-echo` |
| [Enhanced Memcached](https://en.angie.software//angie/docs/configuration/modules/external-modules/enhanced-memcached.md#external-enhanced-memcached) | [v0.3](https://github.com/bpaquet/ngx_http_enhanced_memcached_module) | `angie-module-enhanced-memcached` `angie-pro-module-enhanced-memcached` |
| [Eval](https://en.angie.software//angie/docs/configuration/modules/external-modules/eval.md#external-eval) | [2016.06.10](https://github.com/openresty/nginx-eval-module) | `angie-module-eval` `angie-pro-module-eval` |
| [GeoIP2](https://en.angie.software//angie/docs/configuration/modules/external-modules/geoip2.md#external-geoip2) | [3.4](https://github.com/leev/ngx_http_geoip2_module) | `angie-module-geoip2` `angie-pro-module-geoip2` |
| [Headers More](https://en.angie.software//angie/docs/configuration/modules/external-modules/headers-more.md#external-headers-more) | [v0.39](https://github.com/openresty/headers-more-nginx-module) | `angie-module-headers-more` `angie-pro-module-headers-more` |
| [HTTP Auth RADIUS](https://en.angie.software//angie/docs/configuration/modules/external-modules/http-auth-radius.md#external-http-auth-radius) | [458af16](https://github.com/ten0s/ngx_http_auth_radius_module) | `angie-module-http-auth-radius` `angie-pro-module-http-auth-radius` |
| [JWT](https://en.angie.software//angie/docs/configuration/modules/external-modules/jwt.md#external-jwt) | [v3.4.4](https://github.com/max-lt/nginx-jwt-module) | `angie-module-jwt` `angie-pro-module-jwt` |
| [Keyval](https://en.angie.software//angie/docs/configuration/modules/external-modules/keyval.md#external-keyval) | [0.5.0](https://github.com/kjdev/nginx-keyval) | `angie-module-keyval` `angie-pro-module-keyval` |
| [Lua](https://en.angie.software//angie/docs/configuration/modules/external-modules/lua.md#external-lua): [http_lua_module](https://github.com/openresty/lua-nginx-module), [stream_lua_module](https://github.com/openresty/stream-lua-nginx-module) | [0.10.31](https://github.com/openresty/lua-nginx-module) / [v0.0.17](https://github.com/openresty/stream-lua-nginx-module) | `angie-module-lua` `angie-pro-module-lua` |
| [ModSecurity](https://en.angie.software//angie/docs/configuration/modules/external-modules/modsecurity.md#external-modsec) | [v1.0.4](https://github.com/owasp-modsecurity/ModSecurity-nginx) | `angie-module-modsecurity` `angie-pro-module-modsecurity` |
| [NJS](https://en.angie.software//angie/docs/configuration/modules/external-modules/njs.md#external-njs): [http_js](https://en.angie.software//angie/docs/configuration/modules/external-modules/http_js.md#http-js), [stream_js](https://en.angie.software//angie/docs/configuration/modules/external-modules/stream_js.md#stream-js) | [1.0.0](https://nginx.org/en/docs/njs/) | `angie-module-njs` `angie-pro-module-njs` |
| [NDK](https://en.angie.software//angie/docs/configuration/modules/external-modules/ndk.md#external-ndk) | [v0.3.4](https://github.com/vision5/ngx_devel_kit) | `angie-module-ndk` `angie-pro-module-ndk` |
| [OpenTracing](https://en.angie.software//angie/docs/configuration/modules/external-modules/opentracing.md#external-opentracing) | [0.48.0](https://github.com/opentracing-contrib/nginx-opentracing) | `angie-module-opentracing` `angie-pro-module-opentracing` |
| [OpenTelemetry](https://en.angie.software//angie/docs/configuration/modules/external-modules/otel.md#external-otel) | [v0.1.2](https://github.com/nginxinc/nginx-otel) | `angie-module-otel` `angie-pro-module-otel` |
| [PostgreSQL](https://en.angie.software//angie/docs/configuration/modules/external-modules/postgres.md#external-postgres) | [1.0rc7](https://github.com/FRiCKLE/ngx_postgres) | `angie-module-postgres` `angie-pro-module-postgres` |
| [Redis2](https://en.angie.software//angie/docs/configuration/modules/external-modules/redis2.md#external-redis2) | [v0.15](https://github.com/openresty/redis2-nginx-module) | `angie-module-redis2` `angie-pro-module-redis2` |
| [RTMP](https://en.angie.software//angie/docs/configuration/modules/external-modules/rtmp.md#external-rtmp) | [v1.2.2](https://github.com/arut/nginx-rtmp-module) | `angie-module-rtmp` `angie-pro-module-rtmp` |
| [Set Misc](https://en.angie.software//angie/docs/configuration/modules/external-modules/set-misc.md#external-set-misc) | [v0.33](https://github.com/openresty/set-misc-nginx-module) | `angie-module-set-misc` `angie-pro-module-set-misc` |
| [Subs](https://en.angie.software//angie/docs/configuration/modules/external-modules/subs.md#external-subs) | [e12e965](https://github.com/yaoweibin/ngx_http_substitutions_filter_module) | `angie-module-subs` `angie-pro-module-subs` |
| [TestCookie](https://en.angie.software//angie/docs/configuration/modules/external-modules/testcookie.md#external-testcookie) | [7d263d4](https://github.com/kyprizel/testcookie-nginx-module) | `angie-module-testcookie` `angie-pro-module-testcookie` |
| [UnBrotli](https://en.angie.software//angie/docs/configuration/modules/external-modules/unbrotli.md#external-unbrotli) | [60bed63](https://github.com/clyfish/ngx_unbrotli) | `angie-module-unbrotli` `angie-pro-module-unbrotli` |
| [Upload](https://en.angie.software//angie/docs/configuration/modules/external-modules/upload.md#external-upload) | [2.3.0](https://github.com/fdintino/nginx-upload-module) | `angie-module-upload` `angie-pro-module-upload` |
| [VOD](https://en.angie.software//angie/docs/configuration/modules/external-modules/vod.md#external-vod) | [1.9.0](https://github.com/kaltura/nginx-vod-module) | `angie-module-vod` `angie-pro-module-vod` |
| [VTS](https://en.angie.software//angie/docs/configuration/modules/external-modules/vts.md#external-vts): [module-vts](https://github.com/vozlt/nginx-module-vts), [module-sts](https://github.com/vozlt/nginx-module-sts), [module-stream-sts](https://github.com/vozlt/nginx-module-stream-sts) | [v0.2.5](https://github.com/vozlt/nginx-module-vts) / [v0.1.1](https://github.com/vozlt/nginx-module-sts) / [v0.1.1](https://github.com/vozlt/nginx-module-stream-sts) | `angie-module-vts` `angie-pro-module-vts` |
| [ZIP](https://en.angie.software//angie/docs/configuration/modules/external-modules/zip.md#external-zip) | [1.3.0](https://github.com/evanmiller/mod_zip) | `angie-module-zip` `angie-pro-module-zip` |
| [Zstd](https://en.angie.software//angie/docs/configuration/modules/external-modules/zstd.md#external-zstd) | [f4ba115](https://github.com/tokers/zstd-nginx-module) | `angie-module-zstd` `angie-pro-module-zstd` |
# https://en.angie.software/angie/docs/installation/thirdparty.md
# Third-Party Repositories for Angie
We recommend using our official packages to install Angie:
- [Angie](https://en.angie.software//angie/docs/installation/oss_packages.md#oss-packages)
- [Angie PRO](https://en.angie.software//angie/docs/installation/pro_packages.md#pro-packages)
If you wish to use third-party repositories
that are specific to your system or distribution,
the following options are currently available.
Official repositories of various Linux distributions:
- [ALT Linux](https://packages.altlinux.org/ru/sisyphus/srpms/angie/)
- [Arch User Repository](https://aur.archlinux.org/packages/angie)
- [FreeBSD FreshPorts](https://www.freshports.org/www/angie/)
- [nixpkgs](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/servers/http/angie/default.nix)
- [ROSA Linux ABF](https://abf.io/import/angie/)
Package managers for macOS:
- [Homebrew](https://github.com/stychos/homebrew-angie):
```console
$ brew tap stychos/angie
$ brew install stychos/angie/angie
```
- [MacPorts](https://github.com/macports/macports-ports/tree/master/www/angie):
```console
$ sudo port install angie
```
For an additional list of third-party sources, see [here](https://repology.org/project/angie/versions).
#### NOTE
We do not publish anything in these repositories
and are not responsible for the consequences of installing software from them.
# https://en.angie.software/angie/docs/configuration.md
# Configuration
This page contains articles, references, indexes, and instructions
for configuring Angie.
## General Information
These articles cover installation and configuration of Angie,
starting and stopping the web server, managing it,
as well as various aspects of request processing
and interaction with other servers.
* [Configuration](https://en.angie.software//angie/docs/configuration/configfile.md)
* [Management](https://en.angie.software//angie/docs/configuration/runtime.md)
* [Connections, Sessions, Requests, Logs](https://en.angie.software//angie/docs/configuration/processing.md)
## References and Indexes
These summary sections provide reference information on built-in modules,
examples of their configuration, as well as supported directives and variables.
* [Modules](https://en.angie.software//angie/docs/configuration/modules/index.md)
* [Variables](https://en.angie.software//angie/docs/configuration/varindex.md)
* [NJS API Reference](https://en.angie.software//angie/docs/configuration/njs-reference.md)
You can also use the short link service at [https://angie.ws/](https://angie.ws/)
to quickly find individual directives and variables:
* [Quick Access](https://en.angie.software//angie/docs/configuration/quickaccess.md)
## Instructions
Step-by-step instructions for specific aspects of configuring Angie are provided here.
* [Configuring ACME](https://en.angie.software//angie/docs/configuration/acme.md)
* [Configuring clusters](https://en.angie.software//angie/docs/configuration/cluster.md)
* [Configuring OIDC](https://en.angie.software//angie/docs/configuration/oidc.md)
* [Configuring SSL](https://en.angie.software//angie/docs/configuration/ssl.md)
* [Console Light Panel](https://en.angie.software//angie/docs/configuration/monitoring.md)
* [Custom metrics](https://en.angie.software//angie/docs/configuration/custom-metrics.md)
* [Migrating from nginx](https://en.angie.software//angie/docs/configuration/migration.md)
* [Unsupported nginx Directives](https://en.angie.software//angie/docs/configuration/nginx-unsupported-directives.md)
* [Grafana Panel](https://en.angie.software//angie/docs/configuration/grafana.md)
## Community Materials
We have collected community resources that will help you better understand
configuring and using Angie.
### Articles
- [Angie: A New NGINX Fork Developed by Some of Its Former Devs](https://linuxiac.com/angie-web-server-is-a-new-nginx-fork/)
on Linuxiac
- [What's New in the Angie 1.9 Web Server (an nginx fork) and What to Expect from 1.10?](https://habr.com/en/articles/911444/)
on Habr
### Courses
English-language courses on Angie are not currently available.
Refer to the official Angie documentation and the practical guides below.
### Practical Guides
- [Migrating from Nginx to Angie: A Real-World Journey from Certbot to Built-in ACME](https://dev.to/stan-breaks/migrating-from-nginx-to-angie-a-real-world-journey-from-certbot-to-built-in-acme-7a3)
on DEV Community
### Interviews and Podcasts
- "NGINX is Dead? // Angie Web Server Migration Guide" by DevOps Toolbox
([YouTube](https://www.youtube.com/watch?v=HFCtaiJMDGg), 27.03.2026)
- "Nginx Has a BIG Problem..." by DevOps Toolbox ([YouTube](https://www.youtube.com/watch?v=acJBNVTW42I), 30.01.2026)
## Documentation for AI Assistants
The site ships machine-readable copies of every documentation page
so that LLM-powered tools — Claude Code, Cursor, ChatGPT, and other
agentic assistants — can ingest the content directly instead of
scraping rendered HTML.
### llms.txt and llms-full.txt
Each language subdomain serves an [llms.txt](https://llmstxt.org/)
sitemap with a short project description and a list of every page
(title, absolute URL, annotation). Its companion `llms-full.txt`
concatenates the full Markdown body of every page into a single file
suitable for one-shot ingestion:
- [https://en.angie.software/llms.txt](https://en.angie.software/llms.txt)
- [https://en.angie.software/llms-full.txt](https://en.angie.software/llms-full.txt)
These URLs are also advertised in
[robots.txt](https://en.angie.software/robots.txt) via the
`Llms:` directive, so LLM crawlers discover them automatically.
### Markdown versions of pages
Every HTML page has a Markdown twin. To fetch the Markdown version of
any documentation URL, replace the trailing slash with `.md`:
- HTML: [https://en.angie.software/angie/docs/configuration/](https://en.angie.software/angie/docs/configuration/)
- Markdown: [https://en.angie.software/angie/docs/configuration.md](https://en.angie.software/angie/docs/configuration.md)
Markdown is generated from the same reStructuredText source as the
HTML build, so the content always stays in sync.
### Context7
Angie documentation is indexed on
[Context7](https://context7.com/), a registry that serves
up-to-date library documentation to AI code editors through its
MCP server. The English Angie listing is at
[https://context7.com/websites/en_angie_software_angie](https://context7.com/websites/en_angie_software_angie).
# https://en.angie.software/angie/docs/configuration/configfile.md
# Configuration Files
Angie uses a text-based configuration file. By default, this file is named
`angie.conf` and is located according to the [--conf-path](https://en.angie.software//angie/docs/installation/sourcebuild.md#paths)
build parameter, typically in the `/etc/angie` directory.
A configuration file generally consists of the following contexts:
- [events](https://en.angie.software//angie/docs/configuration/modules/core.md#events) – General connection processing
- [http](https://en.angie.software//angie/docs/configuration/modules/http/index.md#d-http) – HTTP traffic
- [mail](https://en.angie.software//angie/docs/configuration/modules/mail/index.md#m-mail) – Mail traffic
- [stream](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#s-stream) – TCP and UDP traffic
- [wasm_modules](https://en.angie.software//angie/docs/configuration/modules/wasm/index.md#wasm-modules) – WASM runtime
Directives that are placed outside of these contexts are considered to be in the
`main` context:
```nginx
user angie; # a directive in the 'main' context
events {
# configuration of connection processing
}
http {
# Configuration specific to HTTP and affecting all virtual servers
server {
# configuration of HTTP virtual server 1
location /one {
# configuration for processing URIs starting with '/one'
}
location /two {
# configuration for processing URIs starting with '/two'
}
}
server {
# configuration of HTTP virtual server 2
}
}
stream {
# Configuration specific to TCP/UDP and affecting all virtual servers
server {
# configuration of TCP virtual server 1
}
}
```
To simplify configuration management, we recommend using the [include](https://en.angie.software//angie/docs/configuration/modules/core.md#include)
directive in the main `angie.conf` file to reference the contents of
feature-specific files:
```nginx
include /etc/angie/http.d/*.conf;
include /etc/angie/stream.d/*.conf;
```
## Inheritance
In general, a child context (one that is contained within another context, which
is considered its parent) inherits the settings of directives defined at the
parent level. Some directives can appear in multiple contexts; in such cases,
you can override the settings inherited from the parent by including the
directive in the child context.
## Syntax
### Measurement Units
You can specify sizes using the following units:
| No suffix | Bytes |
|-------------|-----------|
| `k`, `K` | Kilobytes |
| `m`, `M` | Megabytes |
| `g`, `G` | Gigabytes |
For example: `1024`, `8k`, `1m`.
The `g` suffix is accepted only by [client_max_body_size](https://en.angie.software//angie/docs/configuration/modules/http/index.md#client-max-body-size),
[directio](https://en.angie.software//angie/docs/configuration/modules/http/index.md#directio), [directio_alignment](https://en.angie.software//angie/docs/configuration/modules/http/index.md#directio-alignment), [worker_rlimit_core](https://en.angie.software//angie/docs/configuration/modules/core.md#worker-rlimit-core),
[proxy_cache_max_range_offset](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-max-range-offset), and the `max_size` and
`min_free` parameters of [proxy_cache_path](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-path). The `fastcgi_`,
`scgi_`, and `uwsgi_` counterparts of the two caching directives
accept it as well. Every other size takes no suffix larger than `m`,
including buffer and shared memory zone sizes: `proxy_buffer_size 1g;`
is a configuration error. The same limit applies to sizes that measure a file:
[proxy_max_temp_file_size](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-max-temp-file-size) defaults to `1024m` but rejects
`1g`.
Time intervals can be specified in milliseconds, seconds, minutes, hours, days,
and so on, using the following suffixes:
| `ms` | Milliseconds |
|--------|-----------------------------------|
| `s` | Seconds |
| `m` | Minutes |
| `h` | Hours |
| `d` | Days |
| `w` | Weeks |
| `M` | Months (assumed equal to 30 days) |
| `y` | Years (assumed equal to 365 days) |
Multiple units can be combined in a single value by specifying them in order
from the most significant to the least significant, optionally separated by
whitespace. For example, `"1h 30m"` specifies the same duration as
`"90m"` or `"5400s"`. A value without a suffix is interpreted as
seconds. It is recommended to always specify a suffix.
Some time intervals can only be specified with second-level resolution.
### Directives
Each directive consists of a name and a set of parameters.
If any part of a directive needs to contain spaces,
it should be enclosed in quotes or escape the spaces:
```nginx
add_header X-MyHeader "foo bar";
add_header X-MyHeader foo\ bar;
```
If a named parameter needs spaces and you use quotes,
its name must be enclosed in quotes as well:
```nginx
server example.com "sid=server 1";
```
### Strings with Variables
Many directives accept a *string with variables* (also called a *complex
value*): a parameter value that mixes literal text with variable references such
as `$name`, `${name}`, and the regular-expression capture variables `$1`
to `$9`. Such a value is compiled once when the configuration is loaded and
re-evaluated for every request or connection, so the resulting string can differ
from one request to the next. A value that contains no `$` behaves as a plain
literal and adds no per-request overhead.
Use the braced form `${name}` to separate a variable name from text that
immediately follows it, as in `${name}_suffix`. The capture variables `$1`
to `$9` are available only where a regular expression with the corresponding
groups has matched, and require a build with PCRE.
There is no backslash escaping of `$`. To include a literal `$`, define a
variable that holds it, for example with [map](https://en.angie.software//angie/docs/configuration/modules/http/http_map.md#id1) or [set](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#set), and reference
that variable in the value.
The available variables depend on the context: those in the [http](https://en.angie.software//angie/docs/configuration/modules/http/index.md#d-http) subsystem differ from those in the [stream](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#s-stream) subsystem;
see the [variable index](https://en.angie.software//angie/docs/configuration/varindex.md#varindex) for the full list. Variables are
produced both by built-in modules and by directives such as [map](https://en.angie.software//angie/docs/configuration/modules/http/http_map.md#id1),
[geo](https://en.angie.software//angie/docs/configuration/modules/http/http_geo.md#id1), and [split_clients](https://en.angie.software//angie/docs/configuration/modules/http/http_split_clients.md#id1).
For some directives the presence of a variable changes runtime behavior: the
value is then resolved dynamically per request rather than fixed at
configuration load, which may require a [resolver](https://en.angie.software//angie/docs/configuration/modules/http/index.md#resolver). The [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass)
directive is one such case.
## Setting Up Hashes
To efficiently process static sets of data, such as server names, the [map](https://en.angie.software//angie/docs/configuration/modules/http/http_map.md#id1)
directive values, MIME types, and request header names, Angie utilizes hash
tables. During startup and each reconfiguration, Angie determines the
optimal size for these hash tables to ensure that the bucket size, which stores
keys with identical hash values, does not exceed the configured parameter (hash
bucket size). The table size is measured in buckets and is adjusted until it
exceeds the hash max size parameter. Most hash tables have corresponding
directives to adjust these parameters, such as [server_names_hash_max_size](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server-names-hash-max-size)
and [server_names_hash_bucket_size](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server-names-hash-bucket-size) for server names.
The hash bucket size parameter is aligned to a multiple of the processor's
cache line size. This alignment enhances key search efficiency on modern
processors by reducing the number of memory accesses. If the hash bucket size
is equal to one cache line size, the maximum number of memory accesses during a
key search will be two: one to compute the bucket address and another to search
inside the bucket. Therefore, if Angie indicates that either the hash max
size or hash bucket size should be increased, start by increasing the hash
max size.
### Reloading Configuration
To apply changes to the configuration file, it must be reloaded. You can either
restart the Angie process with a configuration syntax check beforehand:
```console
$ sudo angie -t && sudo service angie restart
```
Alternatively, you can reload the service to apply the new configuration without
interrupting the processing of current requests:
```console
$ sudo angie -t && sudo service angie reload
```
# https://en.angie.software/angie/docs/configuration/runtime.md
# Runtime Control
To start Angie, use **systemd** with the following command:
```console
$ sudo service angie start
```
It is recommended to check the configuration syntax beforehand. Here is how:
```console
$ sudo angie -t && sudo service angie start
```
To reload the configuration:
```console
$ sudo angie -t && sudo service angie reload
```
To stop Angie:
```console
$ sudo service angie stop
```
After installation, run the following command to ensure that Angie is up and
running:
```console
$ curl localhost:80
```
#### NOTE
The methods for running the open-source version of Angie may vary depending
on the installation method.
Angie has one master process and several worker processes. The master
process is responsible for reading and evaluating the configuration and
maintaining the worker processes. Worker processes handle the actual request
processing. Angie uses an event-based model and OS-dependent mechanisms to
efficiently distribute requests among the worker processes. The number of worker
processes is defined in the configuration file and may be either fixed for a
given configuration or automatically adjusted based on the number of available
CPU cores (see [worker_processes](https://en.angie.software//angie/docs/configuration/modules/core.md#worker-processes)).
When configured, Angie will also flush certain shared memory zones
(currently, the `keys_zone` in [proxy_cache_path](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-path))
to disk before exiting,
so the new master process can restore them
and thereby improve performance.
If the restore fails due to a change in zone size,
binary version incompatibility, or other reasons,
Angie will log a warning (`failed to restore zone at address`)
and will not use the zone restore mechanism.
## Using Signals
Angie can also be controlled using signals. By default, the process ID of
the master process is written to the file `/run/angie.pid`. This
filename can be changed at configuration time or in `angie.conf` using the
[pid](https://en.angie.software//angie/docs/configuration/modules/core.md#pid) directive. The master process supports the following signals:
| `TERM`, `INT` | Fast shutdown |
|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `QUIT` | [Graceful](https://en.angie.software//angie/docs/configuration/modules/core.md#worker-shutdown-timeout) shutdown |
| `HUP` | Reload configuration, update time zone (only for FreeBSD and Linux), start new worker processes with the updated configuration, [gracefully](https://en.angie.software//angie/docs/configuration/modules/core.md#worker-shutdown-timeout) shut down old worker processes |
| `USR1` | Reopen log files |
| `USR2` | Upgrade the executable file |
| `WINCH` | [Graceful](https://en.angie.software//angie/docs/configuration/modules/core.md#worker-shutdown-timeout) shutdown of worker processes |
You can send signals using **kill**:
```console
$ sudo kill -QUIT $(cat /run/angie.pid)
```
Individual worker processes can also be controlled using signals, although this
is optional. The supported signals are:
| `TERM`, `INT` | Fast shutdown |
|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `QUIT` | [Graceful](https://en.angie.software//angie/docs/configuration/modules/core.md#worker-shutdown-timeout) shutdown |
| `USR1` | Reopen log files |
| `WINCH` | Abnormal termination for debugging (requires [debug_points](https://en.angie.software//angie/docs/configuration/modules/core.md#debug-points) to be enabled) |
## Changing Configuration
In order for Angie to re-read the configuration file, a `HUP` signal
should be sent to the master process. The master process first checks the syntax
validity and then attempts to apply the new configuration, which includes
opening new log files and listen sockets. If applying the new configuration
fails, the master process rolls back the changes and continues operating with
the old configuration. If the application succeeds, the master process starts
new worker processes and sends messages to the old worker processes, requesting
them to shut down [gracefully](https://en.angie.software//angie/docs/configuration/modules/core.md#worker-shutdown-timeout). The old worker
processes close their listen sockets and continue to service existing clients.
After all clients have been served, the old worker processes are shut down.
Angie tracks configuration changes for each process. Generation numbers
start at 1 when the server is first started. These numbers are incremented with
each configuration reload and are visible in the process titles:
```console
$ sudo angie
$ ps aux | grep angie
angie: master process v1.12.1 #1 [angie]
angie: worker process #1
```
After a successful configuration reload (regardless of whether there are actual
changes), Angie increments the generation number for processes that received
the new configuration:
```console
$ sudo kill -HUP $(cat /run/angie.pid)
$ ps aux | grep angie
angie: master process v1.12.1 #2 [angie]
angie: worker process #2
```
If any worker processes from previous generations continue to operate,
they will become immediately visible:
```console
$ ps aux | grep angie
angie: worker process #1
angie: worker process #2
```
#### NOTE
Do not confuse the configuration generation number with a 'process number';
Angie does not use continuous process numbering for practical purposes.
## Rotating Log Files
To rotate log files, first rename the files. Then, send a `USR1` signal to
the master process. The master process will re-open all currently open log files
and assign them to an unprivileged user under which the worker processes are
running. After successfully re-opening the files, the master process closes all
open files and notifies the worker processes to re-open their log files. Worker
processes will also open the new files and close the old ones immediately. As a
result, the old files become available for post-processing, such as compression,
almost immediately.
## On-the-fly Executable Upgrade
To upgrade the server executable, first replace the old executable file with the
new one. Then, send a `USR2` signal to the master process. The master
process will rename its current file with the process ID to a new file with the
`.oldbin` suffix, e.g., `/usr/local/angie/logs/angie.pid.oldbin`,
and then start the new executable, which in turn starts new worker processes.
Note that the old master process does not close its listen sockets and can be
managed to restart its worker processes if necessary. If the new executable does
not perform as expected, you can take one of the following actions:
* Send the `HUP` signal to the old master process. This will start new
worker processes without re-reading the configuration. You can then shut down
all new processes [gracefully](https://en.angie.software//angie/docs/configuration/modules/core.md#worker-shutdown-timeout) by sending the
`QUIT` signal to the new master process.
* Send the `TERM` signal to the new master process. It will send a message
to its worker processes, requesting them to exit immediately. If any processes
do not exit, send the `KILL` signal to force them to exit. When the new
master process exits, the old master process will automatically start new
worker processes.
If the new master process exits, the old master process will remove the
`.oldbin` suffix from the file name with the process ID.
If the upgrade is successful, send the `QUIT` signal to the old master
process, and only the new processes will remain.
When configured, Angie will also flush certain shared memory zones
(currently, the `keys_zone` in [proxy_cache_path](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-path))
to disk before upgrading,
so the new master process can restore them
and thereby improve performance.
If the restore fails due to a change in zone size,
binary version incompatibility, or other reasons,
Angie will log a warning (`failed to restore zone at address`)
and will not use the zone restore mechanism.
## Command-Line Options
| `-?`, `-h` | Display help for command-line parameters, then exit. |
|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--build-env` | Display auxiliary information about the build environment, then exit. |
| `-c` file | Use file as the configuration file instead of the [default file](https://en.angie.software//angie/docs/configuration/configfile.md#configfile). |
| `-e` file | Use file as the error log file instead of the [default file](https://en.angie.software//angie/docs/configuration/processing.md#logging). The special value `stderr` specifies the standard error output. |
| `-g` directives | Set [global configuration directives](https://en.angie.software//angie/docs/configuration/modules/core.md#core), for example: `angie -g "pid /var/run/angie.pid; worker_processes `sysctl -n hw.ncpu`;"`. |
| `-m`, `-M` | Display a list of built-in (`-m`) or built-in and loaded (`-M`) modules, then exit. |
| `-p` prefix | Use the specified prefix path for `angie` (the directory where server files are located; the default is `/usr/local/angie/`). |
| `-q` | Display only error messages if `-t` or `-T` is set; otherwise, has no effect. |
| `-s` signal | Send a [signal](#control-signals) to the master process: `stop`, `quit`, `reopen`, `reload`, and so on. |
| `-t` | Test the configuration file, then exit. Angie checks the configuration syntax, recursively including files mentioned in it. |
| `-T` | Same as `-t`, but also outputs the summary configuration to standard output after recursively including all files mentioned in the configuration. |
| `-v` | Display the Angie version, then exit. |
| `-V` | Display the Angie version, compiler version, build time and the [build parameters](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure) used, then exit. |
# https://en.angie.software/angie/docs/configuration/processing.md
# Connections, Sessions, Requests, Logs
## Connection processing mechanisms
Angie supports various connection processing methods. The availability of a
specific method depends on the platform being used. On platforms that support
multiple methods, Angie typically selects the most efficient method
automatically. However, if necessary, a connection processing method can be
explicitly chosen using the [use](https://en.angie.software//angie/docs/configuration/modules/core.md#use) directive.
The following connection processing methods are available:
| Method | Description |
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `select` | A standard method. The supporting module is built automatically on platforms that do not have more efficient methods. The `--with-select_module` and `--without-select_module` build options can be used to forcibly enable or disable the building of this module. |
| `poll` | A standard method. The supporting module is built automatically on platforms that do not have more efficient methods. The `--with-poll_module` and `--without-poll_module` build options can be used to forcibly enable or disable the building of this module. |
| `kqueue` | An efficient method available on FreeBSD 4.1+, OpenBSD 2.9+, NetBSD 2.0, and macOS. |
| `epoll` | An efficient method available on Linux 2.6+. |
| `/dev/poll` | An efficient method available on Solaris 7 11/99+, HP/UX 11.22+ (eventport), IRIX 6.5.15+, and Tru64 UNIX 5.1A+. |
| `eventport` | The `event ports` method is available on Solaris 10+. (Due to known issues, using the `/dev/poll` method is recommended instead.) |
## HTTP request processing
An HTTP request goes through a series of phases, where a specific type of
processing is performed at each phase.
| `Post-read` | The initial phase. The [RealIP](https://en.angie.software//angie/docs/configuration/modules/http/http_realip.md#http-realip) module is invoked during this phase. |
|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Server-rewrite` | The phase where directives from the [Rewrite](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#http-rewrite) module, defined in a `server` block (but outside a `location` block), are processed. |
| `Find-config` | A special phase where a [location](https://en.angie.software//angie/docs/configuration/modules/http/index.md#location) is selected based on the request URI. |
| `Rewrite` | Similar to the `Server-rewrite` phase, but it applies to [rewrite](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#id5) rules defined within the location block selected in the previous phase. |
| `Post-rewrite` | A special phase where the request is redirected to a new location, as in the `Find-config` phase, if its URI was modified during the `Rewrite` phase. |
| `Preaccess` | During this phase, standard Angie modules like [Limit Req](https://en.angie.software//angie/docs/configuration/modules/http/http_limit_req.md#http-limit-req) register their handlers. |
| `Access` | The phase where the client's authorization to make the request is verified, typically by invoking standard Angie modules such as [Auth Basic](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_basic.md#http-auth-basic). |
| `Post-access` | A special phase where the [satisfy any](https://en.angie.software//angie/docs/configuration/modules/http/index.md#satisfy) directive is processed. |
| `Precontent` | Standard module directives, such as [try_files](https://en.angie.software//angie/docs/configuration/modules/http/index.md#try-files) and [mirror](https://en.angie.software//angie/docs/configuration/modules/http/http_mirror.md#id1), register their handlers during this phase. |
| `Content` | The phase where the response is usually generated. Multiple standard Angie modules register their handlers at this stage, including [Index](https://en.angie.software//angie/docs/configuration/modules/http/http_index.md#http-index). The [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass), [fastcgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-pass), [uwsgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#uwsgi-pass), [scgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#scgi-pass) and [grpc_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_grpc.md#grpc-pass) directives are also handled here.
Handlers are called sequentially until one of them produces the output. |
| `Log` | The final phase, where request logging is performed. Currently, only the [Log](https://en.angie.software//angie/docs/configuration/modules/http/http_log.md#http-log) module registers its handler at this stage for access logging. |
## TCP/UDP session processing
A TCP/UDP session from a client goes through a series of phases, where a
specific type of processing is performed at each phase:
| `Post-accept` | The initial phase after accepting a client connection. The [RealIP](https://en.angie.software//angie/docs/configuration/modules/stream/stream_realip.md#stream-realip) module is invoked at this phase. |
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `Pre-access` | A preliminary phase for checking access. The [Set](https://en.angie.software//angie/docs/configuration/modules/stream/stream_set.md#stream-set) modules are invoked during this phase. |
| `Access` | The phase for limiting client access before actual data processing. The [Access](https://en.angie.software//angie/docs/configuration/modules/stream/stream_access.md#stream-access) module is invoked at this stage. |
| `SSL` | The phase where TLS/SSL termination occurs. The [SSL](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl.md#stream-ssl) module is invoked during this phase. |
| `Preread` | The phase for reading initial bytes of data into the [preread buffer](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#s-preread-buffer-size) to allow modules such as [SSL Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl_preread.md#stream-ssl-preread) to analyze the data before processing. |
| `Content` | A mandatory phase where the data is actually processed, typically involving the [Return](https://en.angie.software//angie/docs/configuration/modules/stream/stream_return.md#stream-return) module to send a response to the client. The [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/stream/stream_proxy.md#s-proxy-pass) directive is also handled here. |
| `Log` | The final phase where the outcome of client session processing is recorded. The [Log](https://en.angie.software//angie/docs/configuration/modules/stream/stream_log.md#stream-log) module is invoked at this phase. |
## Processing requests
### Virtual server selection
Initially, a connection is created within the context of a default server. The
server name can then be determined in the following stages of request
processing, each of which is involved in the selection of server configuration:
- During the SSL handshake, in advance, according to the SNI.
- After processing the request line.
- After processing the `Host` header field.
If the server name is not determined after processing the request line or the
`Host` header field, Angie will use an empty name as the server name.
At each of these stages, different server configurations may be applied.
Therefore, certain directives should be specified with caution:
- In the case of the [ssl_protocols](https://en.angie.software//angie/docs/configuration/modules/http/http_ssl.md#ssl-protocols) directive, the protocol list is set by
the OpenSSL library before the server configuration is applied according to
the name requested through SNI. As a result, protocols should only be
specified for the default server.
- The [client_header_buffer_size](https://en.angie.software//angie/docs/configuration/modules/http/index.md#client-header-buffer-size) and [merge_slashes](https://en.angie.software//angie/docs/configuration/modules/http/index.md#merge-slashes) directives are
applied before reading the request line. Therefore, these directives use
either the default server configuration or the server configuration chosen by
SNI.
- In the case of the [ignore_invalid_headers](https://en.angie.software//angie/docs/configuration/modules/http/index.md#ignore-invalid-headers),
[large_client_header_buffers](https://en.angie.software//angie/docs/configuration/modules/http/index.md#large-client-header-buffers), and [underscores_in_headers](https://en.angie.software//angie/docs/configuration/modules/http/index.md#underscores-in-headers)
directives, which are involved in processing request header fields, the server
configuration additionally depends on whether it was updated according to the
request line or the `Host` header field.
- An error response is handled using the [error_page](https://en.angie.software//angie/docs/configuration/modules/http/index.md#error-page) directive in the
server that is currently processing the request.
### Name-based virtual servers
Angie first determines which server should handle the request. Consider a
simple configuration where all three virtual servers listen on port 80:
```nginx
server {
listen 80;
server_name example.org www.example.org;
# ...
}
server {
listen 80;
server_name example.net www.example.net;
# ...
}
server {
listen 80;
server_name example.com www.example.com;
# ...
}
```
In this configuration, Angie determines which server should handle the
request based solely on the `Host` header field. If the value of this
header does not match any server name or if the request does not contain this
header field, Angie will route the request to the default server for this
port. In the configuration above, the default server is the first one — which is
Angie's standard default behavior. It can also be explicitly specified which
server should be the default using the `default_server` parameter in the
[listen](https://en.angie.software//angie/docs/configuration/modules/http/index.md#listen) directive:
```nginx
server {
listen 80 default_server;
server_name example.net www.example.net;
# ...
}
```
#### NOTE
Note that the default server is a property of the listen socket, not of the
server name.
### Internationalized names
Internationalized domain names ([IDNs](https://en.wikipedia.org/wiki/Internationalized_domain_name)) should be
specified using an ASCII (Punycode) representation in the [server_name](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server-name)
directive:
```nginx
server {
listen 80;
server_name xn--e1afmkfd.xn--80akhbyknj4f; # пример.испытание
# ...
}
```
### Preventing requests with undefined server names
If requests without the `Host` header field should not be allowed, a
server that simply drops such requests can be defined:
```nginx
server {
listen 80;
server_name "";
return 444;
}
```
In this configuration, the server name is set to an empty string, which matches
requests without the `Host` header field. A special non-standard code 444
is then returned, which closes the connection.
### Combining name-based and IP-based virtual servers
Let's examine a more complex configuration where some virtual servers listen on
different addresses:
```nginx
server {
listen 192.168.1.1:80;
server_name example.org www.example.org;
# ...
}
server {
listen 192.168.1.1:80;
server_name example.net www.example.net;
# ...
}
server {
listen 192.168.1.2:80;
server_name example.com www.example.com;
# ...
}
```
In this configuration, Angie first tests the IP address and port of the
request against the [listen](https://en.angie.software//angie/docs/configuration/modules/http/index.md#listen) directives of the [server](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server) blocks. It
then tests the `Host` header field of the request against the
[server_name](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server-name) entries of the [server](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server) blocks that matched the IP
address and port. If the server name is not found, the request will be processed
by the default server. For example, a request for `www.example.com`
received on port 192.168.1.1:80 will be handled by the default server for that
port — i.e., by the first server — since `www.example.com` is not defined
for this port.
As previously mentioned, a default server is a property of the listen port, and
different default servers may be defined for different ports:
```nginx
server {
listen 192.168.1.1:80;
server_name example.org www.example.org;
# ...
}
server {
listen 192.168.1.1:80 default_server;
server_name example.net www.example.net;
# ...
}
server {
listen 192.168.1.2:80 default_server;
server_name example.com www.example.com;
# ...
}
```
### Choosing locations
Consider a simple PHP website configuration:
```nginx
server {
listen 80;
server_name example.org www.example.org;
root /data/www;
location / {
index index.html index.php;
}
location ~* \.(gif|jpg|png)$ {
expires 30d;
}
location ~ \.php$ {
fastcgi_pass localhost:9000;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
}
```
Angie first searches for the most specific prefix `location` given by
literal strings, regardless of their listed order. In the configuration above,
the only prefix location is `location /`, which matches any request and
will be used as a last resort. Angie then checks locations defined by
regular expressions in the order they appear in the configuration file. The
first matching expression stops the search, and Angie will use that
`location`. If no regular expression matches a request, Angie will use
the most specific prefix `location` found earlier.
#### NOTE
Locations of all types test only the URI part of the request line, excluding
arguments. This is because arguments in the query string can be specified in
various ways, for example:
- `/index.php?user=john&page=1`
- `/index.php?page=1&user=john`
Additionally, query strings may contain any number of parameters:
- `/index.php?page=1&something+else&user=john`
Now let's look at how requests would be processed in the configuration above:
- The request `/logo.gif` is first matched by the prefix `location
/` and then by the regular expression `.(gif|jpg|png)$`. Therefore, it
is handled by the latter location. Using the directive `root /data/www`,
the request is mapped to the file `/data/www/logo.gif`, and the file is
sent to the client.
- The request `/index.php` is also initially matched by the prefix
`location /` and then by the regular expression `.(php)$`.
Consequently, it is handled by the latter location, and the request is passed
to a FastCGI server listening on `localhost:9000`. The
[fastcgi_param](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-param) directive sets the FastCGI parameter
`SCRIPT_FILENAME` to `/data/www/index.php`, and the FastCGI server
executes the file. The variable [$document_root](https://en.angie.software//angie/docs/configuration/modules/http/index.md#v-document-root) is set to the value of
the `root` directive, and the variable [$fastcgi_script_name](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#v-fastcgi-script-name) is
set to the request URI, i.e., `/index.php`.
- The request `/about.html` is matched only by the prefix `location
/`, so it is handled in this location. Using the directive `root
/data/www`, the request is mapped to the file `/data/www/about.html`,
and the file is sent to the client.
Handling the request `/` is more complex. It is matched only by the prefix
`location /`, so it is handled by this location. The [index](https://en.angie.software//angie/docs/configuration/modules/http/http_index.md#id1) directive then
tests for the existence of index files according to its parameters and the
`root /data/www` directive. If the file `/data/www/index.html` does
not exist but the file `/data/www/index.php` does, the directive performs
an internal redirect to `/index.php`, and Angie searches the locations
again as if the request had been sent by a client. As previously mentioned, the
redirected request will eventually be handled by the FastCGI server.
The examples above map a request to a file through the [root](https://en.angie.software//angie/docs/configuration/modules/http/index.md#root) directive,
but the full mapping involves several directives acting together. Once a
matching [location](https://en.angie.software//angie/docs/configuration/modules/http/index.md#location) is selected, Angie maps the normalized
[$uri](https://en.angie.software//angie/docs/configuration/modules/http/index.md#v-uri) of the request to a filesystem path: the [root](https://en.angie.software//angie/docs/configuration/modules/http/index.md#root)
directive appends the whole URI to its value, whereas the [alias](https://en.angie.software//angie/docs/configuration/modules/http/index.md#alias)
directive replaces the matched location prefix. The [try_files](https://en.angie.software//angie/docs/configuration/modules/http/index.md#try-files) directive
then probes for candidate files relative to that path; if none exist, its last
parameter triggers an internal redirect, and Angie searches the locations again
against the new [$uri](https://en.angie.software//angie/docs/configuration/modules/http/index.md#v-uri), just as with the index redirect above.
For the same request `/images/top.gif`, the two locations below resolve it
to the same file, `/data/w3/images/top.gif`:
```nginx
location /images/ {
root /data/w3; # append: /data/w3 + /images/top.gif
}
location /images/ {
alias /data/w3/images/; # replace: /images/ -> /data/w3/images/, then top.gif
}
```
With [alias](https://en.angie.software//angie/docs/configuration/modules/http/index.md#alias), the matched prefix is removed by its length, so the trailing
slashes of the location and of the alias value must be consistent. Dropping the
trailing slash from the alias path above would instead yield
`/data/w3/imagestop.gif`.
## Proxying and Load Balancing
One common use of Angie is to set it up as a proxy server. In this role,
Angie receives requests, forwards them to the proxied servers, retrieves
responses from those servers, and sends the responses back to the clients.
A simple proxy server:
```nginx
server {
location / {
proxy_pass http://backend:8080;
}
```
The [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass) directive instructs Angie to pass client requests to
the backend `backend:8080` (the proxied server). There are many additional
[directives](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#http-proxy) available for further configuring a proxy
connection.
### FastCGI Proxying
Angie can be used to route requests to FastCGI servers that run applications
built with various frameworks and programming languages, such as PHP.
The most basic Angie configuration for working with a FastCGI server
involves using the [fastcgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-pass) directive instead of the
[proxy_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass) directive, along with [fastcgi_param](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-param) directives to set
parameters passed to the FastCGI server. Suppose the FastCGI server is
accessible on `localhost:9000`. In PHP, the `SCRIPT_FILENAME`
parameter is used to determine the script name, and the `QUERY_STRING`
parameter is used to pass request parameters. The resulting configuration would
be:
```nginx
server {
location / {
fastcgi_pass localhost:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
}
location ~ \.(gif|jpg|png)$ {
root /data/images;
}
}
```
This configuration sets up a server that routes all requests, except those for
static images, to the proxied server operating on `localhost:9000` via the
FastCGI protocol.
### WebSocket Proxying
To upgrade a connection from HTTP/1.1 to WebSocket, the [protocol switch](https://datatracker.ietf.org/doc/html/rfc2616#section-14.42) mechanism
available in HTTP/1.1 is used.
However, there is a subtlety: since the `Upgrade` header is a [hop-by-hop
header](https://datatracker.ietf.org/doc/html/rfc2616#section-13.5.1), it is
not passed from the client to the proxied server. With forward proxying, clients
may use the CONNECT method to circumvent this issue. This approach does not work
with reverse proxying, as clients are unaware of any proxy servers, and special
processing on the proxy server is required.
Angie implements a special mode of operation that allows setting up a tunnel
between a client and a proxied server if the proxied server returns a response
with code 101 (Switching Protocols), and the client requests a protocol switch
via the `Upgrade` header in the request.
As mentioned, hop-by-hop headers, including `Upgrade` and
`Connection`, are not passed from the client to the proxied server.
Therefore, for the proxied server to be aware of the client's intention to
switch to the WebSocket protocol, these headers must be explicitly passed:
```nginx
location /chat/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
```
A more sophisticated example demonstrates how the value of the
`Connection` header field in a request to the proxied server depends on
the presence of the `Upgrade` field in the client request header:
```nginx
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
...
location /chat/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
}
```
By default, the connection will be closed if the proxied server does not
transmit any data within 60 seconds. This timeout can be increased using the
[proxy_read_timeout](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-read-timeout) directive. Alternatively, the proxied server can be
configured to periodically send WebSocket ping frames to reset the timeout and
check if the connection is still active.
### Load Balancing
Load balancing across multiple application instances is a widely used technique
to optimize resource utilization, maximize throughput, reduce latency, and
ensure fault-tolerant configurations.
Angie can be used as a highly efficient HTTP load balancer to distribute
traffic to multiple application servers, thereby enhancing the performance,
scalability, and reliability of web applications.
The simplest configuration for load balancing with Angie might look like
this:
```nginx
http {
upstream myapp1 {
server srv1.example.com;
server srv2.example.com;
server srv3.example.com;
}
server {
listen 80;
location / {
proxy_pass http://myapp1;
}
}
}
```
In the example above, three instances of the same application are running on
`srv1` through `srv3`. When a load balancing method is not
explicitly configured, it defaults to round-robin. Other supported load
balancing mechanisms include: [weight](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server), [least_conn](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-least-conn), and
[ip_hash](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-ip-hash). The reverse proxy implementation in Angie also supports
in-band (or passive) server health probes. These are configured using the
[max_fails](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#max-fails) and [fail_timeout](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#fail-timeout) directives
within the [server](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server) block in the [upstream](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-upstream) context.
## Logging
#### NOTE
In addition to the options listed here,
you can also enable the [debugging log](https://en.angie.software//angie/docs/troubleshooting.md#debug-logging).
### Syslog
The [error_log](https://en.angie.software//angie/docs/configuration/modules/core.md#error-log) and [access_log](https://en.angie.software//angie/docs/configuration/modules/http/http_log.md#access-log) directives support logging to
`syslog`. The following parameters are used to configure logging to
`syslog`:
| `server=`address | Specifies the address of a `syslog` server. The address can be a domain name or an IP address, with an optional port, or a UNIX domain socket path specified after the `"unix:"` prefix. If the port is not specified, UDP port 514 is used. If a domain name resolves to multiple IP addresses, the first resolved address is used. |
|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `facility=`string | Sets the facility for `syslog` messages, as defined in [RFC 3164](https://datatracker.ietf.org/doc/html/rfc3164.html). Possible facilities include: `"kern"`, `"user"`, `"mail"`, `"daemon"`, `"auth"`, `"intern"`, `"lpr"`, `"news"`, `"uucp"`, `"clock"`, `"authpriv"`, `"ftp"`, `"ntp"`, `"audit"`, `"alert"`, `"cron"`, `"local0".."local7"`. The default is `"local7"`. |
| `severity=`string | Defines the severity level of `syslog` messages for [access_log](https://en.angie.software//angie/docs/configuration/modules/http/http_log.md#access-log), as specified in [RFC 3164](https://datatracker.ietf.org/doc/html/rfc3164.html). Possible values are the same as those for the second parameter (level) of the [error_log](https://en.angie.software//angie/docs/configuration/modules/core.md#error-log) directive. The default is `"info"`. The severity of error messages is determined by Angie, so this parameter is ignored in the [error_log](https://en.angie.software//angie/docs/configuration/modules/core.md#error-log) directive. |
| `tag=`string | Sets the tag for `syslog` messages. The default tag is `"angie"`. |
| `nohostname` | Disables the addition of the `hostname` field in the `syslog` message header. |
Example syslog configuration:
```nginx
error_log syslog:server=192.168.1.1 debug;
access_log syslog:server=unix:/var/log/angie.sock,nohostname;
access_log syslog:server=[2001:db8::1]:12345,facility=local7,tag=angie,severity=info combined;
```
# https://en.angie.software/angie/docs/configuration/modules.md
# Modules
This guide describes Angie's modules, both native and third-party,
provides configuration examples, lists their directives and parameters,
as well as built-in variables.
## Core Module
| [Core](https://en.angie.software//angie/docs/configuration/modules/core.md#core) | Management of service files, processes, and other Angie modules. |
|------------------------------------------------------------------------------------|--------------------------------------------------------------------|
## HTTP Modules
| [HTTP](https://en.angie.software//angie/docs/configuration/modules/http/index.md#http-core) | Core functionality for processing HTTP requests and responses, managing the HTTP server, connections, and static files. |
|----------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Access](https://en.angie.software//angie/docs/configuration/modules/http/http_access.md#http-access) | Access control based on IP addresses and CIDR ranges. |
| [ACME](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#http-acme) | Automatic retrieval and renewal of SSL certificates using the ACME protocol for HTTP servers. |
| [Docker](https://en.angie.software//angie/docs/configuration/modules/http/http_docker.md#http-docker) | Dynamic updating of proxied server groups based on Docker container labels. |
| [Addition](https://en.angie.software//angie/docs/configuration/modules/http/http_addition.md#http-addition) | Insertion of a specified snippet before or after the response body. |
| [API](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#http-api) | RESTful HTTP interface for obtaining basic web server information and statistics in JSON format, as well as managing groups of proxied servers. |
| [Auth Basic](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_basic.md#http-auth-basic) | Basic HTTP authentication for access control based on username and password. |
| [Auth Request](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#http-auth-request) | Authorization using a subrequest to an external HTTP service. |
| [AutoIndex](https://en.angie.software//angie/docs/configuration/modules/http/http_autoindex.md#http-autoindex) | Automatic directory listing without an index file. |
| [Browser](https://en.angie.software//angie/docs/configuration/modules/http/http_browser.md#http-browser) (deprecated) | Browser identification based on the `User-Agent` header. |
| [Charset](https://en.angie.software//angie/docs/configuration/modules/http/http_charset.md#http-charset) | Configuration and conversion of response encoding. |
| [DAV](https://en.angie.software//angie/docs/configuration/modules/http/http_dav.md#http-dav) | File management on the server using the WebDAV protocol. |
| [DoH](https://en.angie.software//angie/docs/configuration/modules/http/http_doh.md#http-doh) | DNS over HTTPS (RFC 8484) server that proxies DNS queries to a group of DNS servers over UDP or TCP. |
| [Empty GIF](https://en.angie.software//angie/docs/configuration/modules/http/http_empty_gif.md#http-empty-gif) | Serving a one-pixel transparent GIF. |
| [FastCGI](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#http-fastcgi) | Proxying requests to a FastCGI server. |
| [FLV](https://en.angie.software//angie/docs/configuration/modules/http/http_flv.md#http-flv) | Pseudo-streaming of Flash Video (FLV) files. |
| [Geo](https://en.angie.software//angie/docs/configuration/modules/http/http_geo.md#http-geo) | Converting IP addresses into specified variable values. |
| [GeoIP](https://en.angie.software//angie/docs/configuration/modules/http/http_geoip.md#http-geoip) | Obtaining IP address data based on geolocation using MaxMind GeoIP databases. |
| [gRPC](https://en.angie.software//angie/docs/configuration/modules/http/http_grpc.md#http-grpc) | Proxying requests to a gRPC server. |
| [GunZIP](https://en.angie.software//angie/docs/configuration/modules/http/http_gunzip.md#http-gunzip) | Decompressing GZip-compressed responses for modification and in cases where the client does not support compression. |
| [GZip](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip.md#http-gzip) | Compressing responses using the GZip method to save traffic. |
| [GZip Static](https://en.angie.software//angie/docs/configuration/modules/http/http_gzip_static.md#http-gzip-static) | Serving static files pre-compressed using the GZip method. |
| [Headers](https://en.angie.software//angie/docs/configuration/modules/http/http_headers.md#http-headers) | Modifying response header fields. |
| [HTTP/2](https://en.angie.software//angie/docs/configuration/modules/http/http_v2.md#http-v2) | Processing requests using the HTTP/2 protocol. |
| [HTTP/3](https://en.angie.software//angie/docs/configuration/modules/http/http_v3.md#http-v3) | Processing requests using the HTTP/3 protocol. |
| [Image Filter](https://en.angie.software//angie/docs/configuration/modules/http/http_image_filter.md#http-image-filter) [1](#id8) | Image transformation. |
| [Index](https://en.angie.software//angie/docs/configuration/modules/http/http_index.md#http-index) | Configuration of index files that serve requests ending with a slash (`/`). |
| [Limit Conn](https://en.angie.software//angie/docs/configuration/modules/http/http_limit_conn.md#http-limit-conn) | Limiting the number of concurrent requests (active connections) for protection against overload. |
| [Limit Req](https://en.angie.software//angie/docs/configuration/modules/http/http_limit_req.md#http-limit-req) | Limiting request frequency for protection against overload and password guessing. |
| [Log](https://en.angie.software//angie/docs/configuration/modules/http/http_log.md#http-log) | Configuration of request logs for tracking resource access for monitoring and analysis purposes. |
| [Map](https://en.angie.software//angie/docs/configuration/modules/http/http_map.md#http-map) | Converting variables based on predefined key-value pairs. |
| [Metric](https://en.angie.software//angie/docs/configuration/modules/http/http_metric.md#http-metric) | Custom numeric metrics in the real-time statistics API. |
| [Memcached](https://en.angie.software//angie/docs/configuration/modules/http/http_memcached.md#http-memcached) | Retrieving responses from a Memcached server. |
| [Mirror](https://en.angie.software//angie/docs/configuration/modules/http/http_mirror.md#http-mirror) | Mirroring requests to other servers. |
| [MP4](https://en.angie.software//angie/docs/configuration/modules/http/http_mp4.md#http-mp4) | Pseudo-streaming of MP4 files. |
| [Perl](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl) [1](#id8) | Handlers for extending functionality by specifying additional logic in the Perl language. |
| [Prometheus](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#http-prometheus) | Server metrics in Prometheus-compatible format for monitoring and statistics collection. |
| [Proxy](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#http-proxy) | Reverse proxying requests to other HTTP servers. |
| [Random Index](https://en.angie.software//angie/docs/configuration/modules/http/http_random_index.md#http-random-index) | Random selection of an index file for requests ending with a slash (`/`). |
| [RealIP](https://en.angie.software//angie/docs/configuration/modules/http/http_realip.md#http-realip) | Determining client address and port when operating behind another proxy server. |
| [Referer](https://en.angie.software//angie/docs/configuration/modules/http/http_referer.md#http-referer) | Validation of `Referer` header values. |
| [Rewrite](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#http-rewrite) | Request URI modification, redirects, variable setting, and conditional configuration selection. |
| [SCGI](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#http-scgi) | Proxying requests to an SCGI server. |
| [Secure Link](https://en.angie.software//angie/docs/configuration/modules/http/http_secure_link.md#http-secure-link) | Creating secure links with the ability to limit access time. |
| [Slice](https://en.angie.software//angie/docs/configuration/modules/http/http_slice.md#http-slice) | Splitting requests into multiple subrequests for individual fragments for better caching of large responses. |
| [Split Clients](https://en.angie.software//angie/docs/configuration/modules/http/http_split_clients.md#http-split-clients) | Creating variables for A/B testing, canary releases, sharding, and other scenarios requiring proportional group splitting. |
| [SSI](https://en.angie.software//angie/docs/configuration/modules/http/http_ssi.md#http-ssi) | Processing SSI (Server Side Includes) commands in responses. |
| [SSL](https://en.angie.software//angie/docs/configuration/modules/http/http_ssl.md#http-ssl) | SSL/TLS configuration for processing HTTPS requests. |
| [Stub Status](https://en.angie.software//angie/docs/configuration/modules/http/http_stub_status.md#http-stub-status) (deprecated) | Global connection and request counters in text format. |
| [Sub](https://en.angie.software//angie/docs/configuration/modules/http/http_sub.md#http-sub) | Search and replace fragments in the response body. |
| [Tunnel](https://en.angie.software//angie/docs/configuration/modules/http/http_tunnel.md#http-tunnel) | Handling HTTP/1.1 CONNECT requests and establishing end-to-end tunnels. |
| [Upstream](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#http-upstream) | Configuration of proxied server groups for load balancing. |
| [Upstream Probe](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream_probe.md#http-upstream-probe) | Configuration of active health probes for proxied server groups. |
| [UserID](https://en.angie.software//angie/docs/configuration/modules/http/http_userid.md#http-userid) | Issuing and processing cookies with unique client identifiers for session tracking and analytics. |
| [uWSGI](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#http-uwsgi) | Proxying requests to a uWSGI server. |
| [XSLT](https://en.angie.software//angie/docs/configuration/modules/http/http_xslt.md#http-xslt) [1](#id8) | Transforming XML documents using the XSLT language. |
## Stream Modules
| [Stream](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#stream-core) | Core stream server functionality for balancing TCP and UDP protocols at the L4 level. |
|-------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| [Access](https://en.angie.software//angie/docs/configuration/modules/stream/stream_access.md#stream-access) | Access control based on IP addresses and CIDR ranges. |
| [ACME](https://en.angie.software//angie/docs/configuration/modules/stream/stream_acme.md#stream-acme) | Automatic retrieval and renewal of SSL certificates using the ACME protocol for stream servers. |
| [Geo](https://en.angie.software//angie/docs/configuration/modules/stream/stream_geo.md#stream-geo) | Converting IP addresses into specified variable values. |
| [GeoIP](https://en.angie.software//angie/docs/configuration/modules/stream/stream_geoip.md#stream-geoip) | Obtaining IP address data based on geolocation using MaxMind GeoIP databases. |
| [Limit Conn](https://en.angie.software//angie/docs/configuration/modules/stream/stream_limit_conn.md#stream-limit-conn) | Limiting the number of concurrent connections for protection against overload. |
| [Log](https://en.angie.software//angie/docs/configuration/modules/stream/stream_log.md#stream-log) | Configuration of session logs for tracking resource access for monitoring and analysis purposes. |
| [Map](https://en.angie.software//angie/docs/configuration/modules/stream/stream_map.md#stream-map) | Converting variables based on predefined key-value pairs. |
| [Metric](https://en.angie.software//angie/docs/configuration/modules/stream/stream_metric.md#stream-metric) | Custom numeric metrics in the real-time statistics API. |
| [MQTT Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_mqtt_preread.md#stream-mqtt-preread) | Reading client identifier and username from MQTT connections before making load balancing decisions. |
| [Pass](https://en.angie.software//angie/docs/configuration/modules/stream/stream_pass.md#stream-pass) | Passing accepted connections directly to a configured listening socket. |
| [Proxy](https://en.angie.software//angie/docs/configuration/modules/stream/stream_proxy.md#stream-proxy) | Configuration of proxying to other servers. |
| [RDP Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_rdp_preread.md#stream-rdp-preread) | Reading cookies from RDP connections before making load balancing decisions. |
| [RealIP](https://en.angie.software//angie/docs/configuration/modules/stream/stream_realip.md#stream-realip) | Determining client address and port when operating behind another proxy server. |
| [Return](https://en.angie.software//angie/docs/configuration/modules/stream/stream_return.md#stream-return) | Sending a specified value to the client upon connection without further proxying. |
| [Set](https://en.angie.software//angie/docs/configuration/modules/stream/stream_set.md#stream-set) | Setting specified variable values. |
| [Split Clients](https://en.angie.software//angie/docs/configuration/modules/stream/stream_split_clients.md#stream-split-clients) | Creating variables for A/B testing, canary releases, sharding, and other scenarios requiring proportional group splitting. |
| [SSL](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl.md#stream-ssl) | SSL/TLS and DTLS protocol termination. |
| [SSL Preread](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl_preread.md#stream-ssl-preread) | Extracting information from `ClientHello` messages without SSL/TLS termination and before making load balancing decisions. |
| [Upstream](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#stream-upstream) | Configuration of proxied server groups for load balancing. |
| [Upstream Probe](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream_probe.md#stream-upstream-probe) | Configuration of active health probes for proxied server groups. |
## Mail Modules
| [Mail](https://en.angie.software//angie/docs/configuration/modules/mail/index.md#mail-core) | Core mail proxy server functionality. |
|----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| [Auth HTTP](https://en.angie.software//angie/docs/configuration/modules/mail/mail_auth_http.md#mail-auth-http) | User authentication and server selection for subsequent proxying using HTTP requests to an external server. |
| [IMAP](https://en.angie.software//angie/docs/configuration/modules/mail/mail_imap.md#mail-imap) | IMAP protocol support. |
| [POP3](https://en.angie.software//angie/docs/configuration/modules/mail/mail_pop3.md#mail-pop3) | POP3 protocol support. |
| [Proxy](https://en.angie.software//angie/docs/configuration/modules/mail/mail_proxy.md#mail-proxy) | Configuration of proxying to other servers. |
| [RealIP](https://en.angie.software//angie/docs/configuration/modules/mail/mail_realip.md#mail-realip) | Determining client address and port when operating behind another proxy server. |
| [SMTP](https://en.angie.software//angie/docs/configuration/modules/mail/mail_smtp.md#mail-smtp) | SMTP protocol support. |
| [SSL](https://en.angie.software//angie/docs/configuration/modules/mail/mail_ssl.md#mail-ssl) | SSL/TLS and StartTLS protocol support. |
## Google PerfTools Module
| [Google PerfTools](https://en.angie.software//angie/docs/configuration/modules/google_perftools.md#google-perftools) | Responsible for integration with the Google Performance Tools library for application profiling and performance analysis. |
|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
## WASM Modules
| [WASM](https://en.angie.software//angie/docs/configuration/modules/wasm/index.md#wasm-core) [1](#id8) | Core WASM functionality enabling WASM code execution in Angie. |
|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| [WAMR](https://en.angie.software//angie/docs/configuration/modules/wasm/wasm_wamr.md#wasm-wamr) | Integration with [WebAssembly Micro Runtime](https://github.com/bytecodealliance/wasm-micro-runtime). |
| [Wasmtime](https://en.angie.software//angie/docs/configuration/modules/wasm/wasm_wasmtime.md#wasm-wasmtime) | Integration with the [Wasmtime](https://wasmtime.dev/) runtime environment. |
## Third-party Modules
Third-party nginx-compatible modules for which we build packages.
The full annotated list with brief descriptions is in the
[Third-Party Modules](https://en.angie.software//angie/docs/configuration/modules/external-modules/index.md#list-of-modules) section.
### Footnotes
* **[1]** In our builds, these modules are compiled dynamically and installed as [separate packages](https://en.angie.software//angie/docs/installation/index.md#install-packages); for details, see the description of each module.
# https://en.angie.software/angie/docs/configuration/modules/core.md
# Core Module
The module provides essential functionality and configuration directives
necessary for the basic operation of the server,
and handles critical tasks such as managing worker processes,
configuring event-driven models,
and processing incoming connections and requests.
It includes key directives for setting up the main process, error
logging, and controlling the behavior of the server at a low level.
## Configuration Example
```nginx
user www www;
worker_processes 2;
error_log /var/log/error.log info;
events {
use kqueue; worker_connections 2048;
}
```
## Directives
### accept_mutex
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `accept_mutex` `on` | `off`; |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default | `accept_mutex off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | events |
When `accept_mutex` is enabled,
worker processes will accept new connections in turn.
Without this setting, all worker processes are notified of new connections,
which can lead to inefficient use of system resources
if the volume of new connections is low.
#### NOTE
There is no need to enable `accept_mutex` on systems
that support the `EPOLLEXCLUSIVE` flag
or when using the [reuseport](https://en.angie.software//angie/docs/configuration/modules/http/index.md#listen) directive.
### accept_mutex_delay
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `accept_mutex_delay` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| Default | `accept_mutex_delay 500ms;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | events |
If [accept_mutex](#accept-mutex) is enabled,
this directive specifies the maximum time
a worker process will wait
to continue accepting new connections
while another worker process is already handling new connections.
### daemon
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `daemon` `on` | `off`; |
|------------------------------------------------------------------------------------------|--------------------------|
| Default | `daemon on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Determines whether Angie should run as a daemon.
This is primarily used during development.
### debug_connection
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `debug_connection` address | CIDR | `unix:`; |
|------------------------------------------------------------------------------------------|------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | events |
Enables debugging logs for specific client connections.
Other connections will use the logging level
set by the [error_log](#error-log) directive.
You can specify connections by IPv4 or IPv6 address, network, or hostname.
For connections using UNIX domain sockets,
use the `unix:` parameter to enable debugging logs.
```nginx
events {
debug_connection 127.0.0.1;
debug_connection localhost;
debug_connection 192.0.2.0/24;
debug_connection ::1;
debug_connection 2001:0db8::/32;
debug_connection unix:;
# ...
}
```
#### NOTE
For this directive to work,
Angie must be built with [debugging log](https://en.angie.software//angie/docs/troubleshooting.md#debug-logging) enabled.
### debug_points
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `debug_points` `abort` | `stop`; |
|------------------------------------------------------------------------------------------|------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
This directive is used for debugging.
When an internal error occurs,
such as a socket leak during worker process restarts,
enabling `debug_points` will either create a core file (`abort`)
or stop the process (`stop`) for further analysis with a system debugger.
### env
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `env` variable[=value]; |
|------------------------------------------------------------------------------------------|---------------------------|
| Default | `env TZ;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
By default,
Angie removes all environment variables inherited from its parent process
except for the `TZ` variable.
This directive allows you to preserve some inherited variables,
modify their values, or create new environment variables.
These variables are then:
- inherited during a
[live upgrade of an executable file](https://en.angie.software//angie/docs/configuration/runtime.md#service-upgrade)
- used by the [Perl](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl) module
- available to worker processes
Note that controlling system libraries in this way may not always be effective,
as libraries often check variables only during initialization,
which occurs before this directive takes effect.
The `TZ` variable is always inherited
and accessible to the [Perl](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl) module
unless explicitly configured otherwise.
Example:
```nginx
env MALLOC_OPTIONS;
env PERL5LIB=/data/site/modules;
env OPENSSL_ALLOW_PROXY_CERTS=1;
```
#### NOTE
The `ANGIE` environment variable is used internally by Angie
and should not be set directly by the user.
### error_log
#### Versionchanged
Changed in version 1.12.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `error_log` file [level] [[`filter=`part:match] ...] [`rate=`rate] [`format=`format]; |
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Default | `error_log logs/error.log error;` (the path depends on the `--error-log-path` [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#paths)) |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main, http, mail, stream, server, location |
Configures logging,
allowing multiple logs to be specified at the same configuration level.
If a log file is not explicitly defined at the `main` configuration level,
the default file will be used.
The first parameter specifies the file to store the log.
The special value `stderr` selects the standard error stream.
To configure logging to [syslog](https://en.angie.software//angie/docs/configuration/processing.md#syslog-logging),
use the `"syslog:"` prefix.
To log to a [cyclic memory buffer](https://en.angie.software//angie/docs/troubleshooting.md#cyclic-memory-buffer),
use the `"memory:"` prefix followed by the buffer size;
this is typically used for debugging.
The second parameter sets the logging level, which can be one of the following:
`debug`, `info`, `notice`, `warn`, `error`,
`crit`, `alert`, or `emerg`.
These levels are listed in order of increasing severity.
Setting a log level will capture messages of equal and higher severity:
| Setting | Levels Captured |
|-----------|--------------------------------------------------------------------------|
| `debug` | `debug`, `info`, `notice`, `warn`, `error`, `crit`, `alert`, `emerg` |
| `info` | `info`, `notice`, `warn`, `error`, `crit`, `alert`, `emerg` |
| `notice` | `notice`, `warn`, `error`, `crit`, `alert`, `emerg` |
| `warn` | `warn`, `error`, `crit`, `alert`, `emerg` |
| `error` | `error`, `crit`, `alert`, `emerg` |
| `crit` | `crit`, `alert`, `emerg` |
| `alert` | `alert`, `emerg` |
| `emerg` | `emerg` |
If this parameter is omitted,
`error` is used as the default logging level.
Optional `filter=`part:match parameters restrict which messages
are written to the log, so a single destination can collect only the events
of interest. Each parameter tests one part of the message against the
match pattern, where part is one of:
- `logline` — with `format=default`, the message together with
any system error and context details, but without the timestamp, level,
process, thread, and connection prefix; it does not match entries with
`format=json`;
- `message` — with `format=default`, the message text without
system error or context details; with `format=json`, the escaped,
serialized fragment containing the `message` member rather than its
raw value;
- `tag` — a tag attached to the message, including tags added by the
[error_log_user_tag](https://en.angie.software//angie/docs/configuration/modules/http/index.md#error-log-user-tag) directive and its [stream](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#s-error-log-user-tag) and [mail](https://en.angie.software//angie/docs/configuration/modules/mail/index.md#m-error-log-user-tag) counterparts;
- `sourcefile` — the source file that emitted the message; available
only when Angie is built with the [debugging log](https://en.angie.software//angie/docs/troubleshooting.md#debug-logging)
enabled;
- any other name — a field of the message context, such as one of the fields
shown in the JSON format below.
By default the match pattern is matched as a substring. Prefix it with
`=` to require an exact match, or with `~` to match a regular
expression, which requires a build with the PCRE library.
With `format=json`, an exact `message` match must cover the entire
serialized fragment, including its JSON syntax and escaping.
Several `filter=` parameters may be given for one directive; a message
is written only when it matches all of them.
Optional `rate=`rate parameter limits the maximum rate of messages
written to the log, in messages per second; the value may end
with the `m/s` suffix (for example, `rate=2000m/s`). By default,
`rate=1000` (1000 messages per second) is used; set `rate=0`
to disable the limit.
The limit is applied separately to each `error_log` directive
and independently in each worker process. A flood of low-severity messages
(for example `info`) does not suppress higher-severity ones such as
`error`, because more severe levels are allowed a proportionally
larger burst; the reverse is not true. Excess messages are dropped. This
throttles the log rather than muting it: under sustained overload, messages
are still written at approximately the configured rate.
When a rate-limited destination is not the head of the effective error-log
chain, the first dropped message also produces a "too many log messages,
limiting" notice at the same level. The notice can recur during sustained
overload. It is suppressed for the chain head, including when that is the only
destination.
Rate limiting doesn't apply when the `debug` logging level is in
effect for a message — either because the log file itself uses the
`debug` level, or because debugging logs are enabled for the
connection via [debug_connection](#debug-connection).
#### NOTE
For the `debug` logging level to work,
Angie must be built with [debugging log](https://en.angie.software//angie/docs/troubleshooting.md#debug-logging) enabled.
Optional `format=`format parameter selects the format used for log
entries. The default, `format=default`, produces the traditional
plain-text format described below; `format=json` writes each entry as
a single JSON object on one line.
In the default format, each entry in the error log has the following format:
```text
timestamp [level] PID#TID: *connection_id message
```
Where:
- `timestamp` — date and time of the event
- `level` — logging level of the event
- `PID#TID` — process and thread identifiers
- `*connection_id` — connection serial number, shared by all requests on the same connection (if applicable)
- `message` — error or event message text
With `format=json`, each entry is instead written as a single JSON
object, shown here pretty-printed for readability; in the log file it
occupies a single line:
```json
{
"time": "2026-02-14T09:23:10.874Z",
"level": "error",
"pid": 22738,
"tid": 22738,
"connection": 7,
"message": "limiting requests, excess: 1.000 by zone \"one\"",
"http": {
"client": "127.0.0.1",
"request": {
"server": "localhost",
"request_line": "GET /debug HTTP/1.1",
"host": "localhost"
}
},
"tags": [
"http"
]
}
```
Where:
- `time` — date and time of the event, in ISO 8601 format
- `level` — logging level of the event
- `pid` and `tid` — process and thread identifiers
- `connection` — connection number (the same value shown as
`*connection_id` in the plain-text format), present when the entry is
associated with a connection
- `message` — error or event message text
- `error` — present when the message is associated with a system
error; an object with `code` and `message` fields
- `http`, `stream`, or `mail` — an object with the
entry's context details, keyed by the name of the module where the entry
originated (a generic `context` object is used for context details
outside these modules); the object only appears for entries that carry
such details and are logged at a level other than `debug`. Each
module's object has its own set of fields; for example, under
`http` a nested `request` object holds `request_line`,
the request line, along with other request details
- `tags` — list of tags attached to the entry, present when at least
one tag applies; includes tags added automatically by modules and by
[error_log_user_tag](https://en.angie.software//angie/docs/configuration/modules/http/index.md#error-log-user-tag) directives
- `truncated` — `true`, present only when the entry had to be
truncated to fit the error log buffer
### events
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `events` { ... }; |
|------------------------------------------------------------------------------------------|---------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Provides the configuration file context for directives
that affect connection processing.
### include
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `include` file | mask; |
|------------------------------------------------------------------------------------------|--------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | any |
Includes another file, or files that match the specified mask,
into the configuration.
The included files must contain syntactically correct directives and blocks.
Example:
```nginx
include mime.types;
include vhosts/*.conf;
```
### load_module
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `load_module` file; |
|------------------------------------------------------------------------------------------|-----------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Loads a dynamic module from the specified file.
If a relative path is provided, it is interpreted based on the
`--prefix` [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure). To verify the path:
```console
$ sudo angie -V
```
Example:
```nginx
load_module modules/ngx_mail_module.so;
```
If a dynamic module was built for a different Angie build, loading fails with an
error like: "module "..." was built for "..." but you are running "Angie"".
### lock_file
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `lock_file` file; |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Default | `lock_file logs/angie.lock;` (the path depends on the `--lock-path` [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#paths)) |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Angie uses a locking mechanism to implement [accept_mutex](#accept-mutex)
and serialize access to shared memory.
On most systems, locks are managed using atomic operations,
making this directive unnecessary.
On certain systems, however, an alternative lock file mechanism is used.
This directive sets a prefix for lock file names.
### master_process
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `master_process` `on` | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------|
| Default | `master_process on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Determines whether worker processes are started.
This directive is intended for Angie developers.
### multi_accept
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `multi_accept` `on` | `off`; |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default | `multi_accept off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | events |
| `on` | A worker process will accept all new connections simultaneously. |
|--------|--------------------------------------------------------------------|
| `off` | A worker process will accept one new connection at a time. |
#### NOTE
This directive is ignored
if the [kqueue](https://en.angie.software//angie/docs/configuration/processing.md#kqueue) connection processing method is used,
as it provides the number of new connections ready to be accepted.
### pcre_jit
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `pcre_jit` `on` | `off`; |
|------------------------------------------------------------------------------------------|----------------------------|
| Default | `pcre_jit off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Enables or disables "just-in-time compilation" (PCRE JIT)
for regular expressions known at the time of configuration parsing.
PCRE JIT can significantly accelerate regular expression processing.
#### NOTE
JIT is available in PCRE libraries from version 8.20,
provided they are built with the `--enable-jit` configuration option.
When Angie is built with the PCRE library (`--with-pcre=`),
JIT support is enabled using the `--with-pcre-jit` option.
### pid
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `pid` file | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| Default | `pid logs/angie.pid;` (the path depends on the `--pid-path` [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#paths)) |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Specifies the file that will store the ID of the Angie main process.
The file is created atomically, which ensures its contents are always correct.
The `off` setting disables the creation of this file.
#### NOTE
If the file setting is modified during reconfiguration
but points to a symlink of the previous PID file,
the file will not be recreated.
### ssl_engine
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `ssl_engine` device; |
|------------------------------------------------------------------------------------------|------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Specifies the name of the hardware SSL accelerator.
### ssl_object_cache_inheritable
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `ssl_object_cache_inheritable` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------------------|
| Default | `ssl_object_cache_inheritable on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
If enabled, SSL objects (SSL certificates, secret keys, trusted CA certificates,
CRL lists) are inherited across configuration reloads.
SSL objects loaded from files are inherited if their modification time and file
index have not changed since the previous configuration load. Secret keys
specified as `engine:name:id` are never inherited, while secret keys
specified as `data:value` are always inherited.
SSL objects loaded from variables cannot be inherited.
Example:
```nginx
ssl_object_cache_inheritable on;
http {
server {
ssl_certificate example.com.crt;
ssl_certificate_key example.com.key;
}
}
```
### thread_pool
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `thread_pool` name `threads=`number [`max_queue=`number]; |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------|
| Default | `thread_pool default threads=32 max_queue=65536;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Defines the name and parameters of a thread pool
used for multi-threaded reading and sending of files
[without blocking](https://en.angie.software//angie/docs/configuration/modules/http/index.md#aio) worker processes.
The `threads` parameter defines the number of threads in the pool.
If all threads in the pool are busy executing tasks, new tasks wait in a queue.
The `max_queue` parameter limits the number of tasks
allowed to be waiting in the queue.
By default, up to 65536 tasks can be in the queue.
When the queue overflows, the task is completed with an error.
### timer_resolution
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `timer_resolution` interval; |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Reduces timer resolution in worker processes,
thus reducing the number of `gettimeofday()` system calls.
By default, `gettimeofday()` is called each time a kernel event is received.
With reduced resolution, `gettimeofday()` is only called once per specified interval.
Example:
```nginx
timer_resolution 100ms;
```
Internal implementation of the interval depends on the method used:
- the `EVFILT_TIMER` filter if [kqueue](https://en.angie.software//angie/docs/configuration/processing.md#kqueue) is used;
- `timer_create()` if [eventport](https://en.angie.software//angie/docs/configuration/processing.md#eventport) is used;
- `setitimer()` otherwise.
### use
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `use` method; |
|------------------------------------------------------------------------------------------|-----------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | events |
Specifies the method to use for [connection processing](https://en.angie.software//angie/docs/configuration/processing.md#methods-use).
There is normally no need to specify it explicitly,
because Angie will by default use the most efficient method.
### user
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `user` user [group]; |
|------------------------------------------------------------------------------------------|------------------------------------------------------------|
| Default | `user ;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Defines user and group credentials used by worker processes
(see also [build parameters](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)).
If group is omitted, a group whose name equals that of user is used.
### worker_aio_requests
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `worker_aio_requests` number; |
|------------------------------------------------------------------------------------------|---------------------------------|
| Default | `worker_aio_requests 32;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | events |
When using [aio](https://en.angie.software//angie/docs/configuration/modules/http/index.md#aio) with the [epoll](https://en.angie.software//angie/docs/configuration/processing.md#epoll) connection processing method,
sets the maximum number of outstanding asynchronous I/O operations
for a single worker process.
### worker_connections
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `worker_connections` number; |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default | `worker_connections 512;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | events |
Sets the maximum number of simultaneous connections that can be opened by a worker process.
It should be kept in mind that this number includes all connections
(e.g. connections with proxied servers, among others),
not only connections with clients.
Another consideration is that the actual number of simultaneous connections
cannot exceed the current limit on the maximum number of open files,
which can be changed by [worker_rlimit_nofile](#worker-rlimit-nofile).
### worker_cpu_affinity
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `worker_cpu_affinity` cpumask ...;
`worker_cpu_affinity` auto [cpumask]; |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Binds worker processes to the sets of CPUs.
Each CPU set is represented by a bitmask of allowed CPUs.
There should be a separate set defined for each of the worker processes.
By default, worker processes are not bound to any specific CPUs.
For example:
```nginx
worker_processes 4;
worker_cpu_affinity 0001 0010 0100 1000;
```
This configuration binds each worker process to a separate CPU.
Alternatively:
```nginx
worker_processes 2;
worker_cpu_affinity 0101 1010;
```
This binds the first worker process to CPU0 and CPU2,
and the second worker process to CPU1 and CPU3.
This setup is suitable for hyper-threading.
The special value `auto`
allows binding worker processes automatically to available CPUs:
```nginx
worker_processes auto;
worker_cpu_affinity auto;
```
The optional mask parameter can be used to limit the CPUs
available for automatic binding:
```nginx
worker_cpu_affinity auto 01010101;
```
#### NOTE
The directive is only available on FreeBSD and Linux.
### worker_priority
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `worker_priority` number; |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default | `worker_priority 0;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Defines the scheduling priority for worker processes like it is done
by the **nice** command: a negative number
means higher priority.
Allowed range normally varies from -20 to 20.
Example:
```nginx
worker_priority -10;
```
### worker_processes
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `worker_processes` number | `auto`; |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default | `worker_processes 1;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Defines the number of worker processes.
The optimal value depends on many factors including (but not limited to)
the number of CPU cores, the number of hard disk drives that store data,
and load pattern.
When one is in doubt, setting it to the number of available CPU cores
would be a good start (the value "`auto`" will try to autodetect it).
### worker_rlimit_core
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `worker_rlimit_core` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Changes the limit on the largest size of a core file (`RLIMIT_CORE`)
for worker processes.
Used to increase the limit without restarting the main process.
### worker_rlimit_nofile
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `worker_rlimit_nofile` number; |
|------------------------------------------------------------------------------------------|----------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Changes the limit on the maximum number of open files (`RLIMIT_NOFILE`)
for worker processes.
Used to increase the limit without restarting the main process.
### worker_shutdown_timeout
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `worker_shutdown_timeout` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Configures a timeout for a graceful shutdown of worker processes.
When the specified time expires,
Angie will try to close all the connections currently open
to facilitate shutdown.
Graceful shutdown is initiated by sending a [QUIT signal](https://en.angie.software//angie/docs/configuration/runtime.md#control-signals) to the main process, which instructs worker processes
to stop accepting new connections and allows existing connections to complete.
Worker processes continue to handle active requests until they finish,
then shut down gracefully. If connections remain open
longer than `worker_shutdown_timeout`, Angie will forcibly close these
connections to complete the shutdown.
Also, client keep-alive connections are closed only if they have been
idle for at least the time specified by [lingering_timeout](https://en.angie.software//angie/docs/configuration/modules/http/index.md#lingering-timeout).
### working_directory
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `working_directory` directory; |
|------------------------------------------------------------------------------------------|----------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Defines the current working directory for a worker process.
It is primarily used when writing a core file,
in which case a worker process should have write permission for the
specified directory.
# https://en.angie.software/angie/docs/configuration/modules/http.md
# HTTP Module
The core HTTP module implements the basic functionality of an HTTP server: this
includes defining server blocks, configuring locations for request routing,
serving static files and controlling access, configuring redirects, supporting
keep-alive connections, and managing request and response headers.
The other modules in this section extend this functionality, allowing you to
flexibly configure and optimize the HTTP server for various scenarios and
requirements.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the HTTP server and
its modules are built by default; they can be disabled altogether with the
[build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure) `--without-http`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
HTTP server is included in the build.
## Directives
### absolute_redirect
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `absolute_redirect` `on` | `off`; |
|------------------------------------------------------------------------------------------|-------------------------------------|
| Default | `absolute_redirect on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
If disabled, redirects issued by Angie will be relative.
See also [server_name_in_redirect](#server-name-in-redirect) and [port_in_redirect](#port-in-redirect) directives.
### aio
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `aio` `on` | `off` | `threads` [=pool]; |
|------------------------------------------------------------------------------------------|-------------------------------------------|
| Default | `aio off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables the use of asynchronous file I/O (AIO) on FreeBSD and Linux:
```nginx
location /video/ {
aio on;
output_buffers 1 64k;
}
```
On FreeBSD, AIO can be used starting from FreeBSD 4.3. Prior to FreeBSD 11.0, AIO can either be linked statically into a kernel:
```nginx
options VFS_AIO
```
or loaded dynamically as a kernel loadable module:
```nginx
kldload aio
```
On Linux, AIO can be used starting from kernel version 2.6.22. Also, it is necessary to enable [directio](#directio), or otherwise reading will be blocking:
```nginx
location /video/ {
aio on;
directio 512;
output_buffers 1 128k;
}
```
On Linux, [directio](#directio) can only be used for reading blocks that are aligned on 512-byte boundaries (or 4K for XFS). File's unaligned end is read in blocking mode. The same holds true for byte range requests and for FLV requests not from the beginning of a file: reading of unaligned data at the beginning and end of a file will be blocking.
When both AIO and [sendfile](#sendfile) are enabled on Linux, AIO is used for files that are larger than or equal to the size specified in the [directio](#directio) directive, while [sendfile](#sendfile) is used for files of smaller sizes or when [directio](#directio) is disabled:
```nginx
location /video/ {
sendfile on;
aio on;
directio 8m;
}
```
Finally, files can be read and [sent](#sendfile) using multi-threading, without blocking a worker process:
```nginx
location /video/ {
sendfile on;
aio threads;
}
```
Read and send file operations are offloaded to threads of the specified [pool](https://en.angie.software//angie/docs/configuration/modules/core.md#thread-pool). If the pool name is omitted, the pool with the name "default" is used. The pool name can also be set with variables:
```nginx
aio threads=pool$disk;
```
Using `aio on` requires building with the `--with-file-aio`
configuration parameter. Using `aio threads` requires building with the
`--with-threads` parameter.
Currently, multi-threading is compatible only with the [epoll](https://en.angie.software//angie/docs/configuration/processing.md#epoll),
[kqueue](https://en.angie.software//angie/docs/configuration/processing.md#kqueue), and [eventport](https://en.angie.software//angie/docs/configuration/processing.md#eventport) methods.
Multi-threaded sending of files is only supported on Linux.
See also the [sendfile](#sendfile) directive.
### aio_write
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `aio_write` `on` | `off`; |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default | `aio_write off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
If [aio](#aio) is enabled, specifies whether it is used for writing files. Currently, this only works when using `aio threads` and is limited to writing temporary files with data received from proxied servers.
### alias
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `alias` path; |
|------------------------------------------------------------------------------------------|-----------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | location |
Defines a replacement for the specified location. For example, with the following configuration:
```nginx
location /i/ {
alias /data/w3/images/;
}
```
on request of `/i/top.gif`, the file /data/w3/images/top.gif will be sent.
The path value can contain [variables](https://en.angie.software//angie/docs/configuration/configfile.md#string-variables), except [$document_root](#v-document-root) and [$realpath_root](#v-realpath-root).
If `alias` is used inside a location defined with a regular expression then such regular expression should contain captures and `alias` should refer to these captures, for example:
```nginx
location ~ ^/users/(.+\.(?:gif|jpe?g|png))$ {
alias /data/w3/images/$1;
}
```
When location matches the last part of the directive's value:
```nginx
location /images/ {
alias /data/w3/images/;
}
```
it is better to use the [root](#root) directive instead:
```nginx
location /images/ {
root /data/w3;
}
```
#### WARNING
With `alias`, the matched location prefix is stripped from the URI by
its length, and the prefix itself is not re-validated. Keep the trailing
slash of the location name and of the `alias` value consistent. If
the `alias` value omits a trailing slash that the location has, the
remainder is concatenated (e.g. `/data/w3/imagestop.gif`) and the
wrong file is served; the reverse merely doubles a slash, which is usually
harmless. For a location that
matches the last part of the path, prefer the [root](#root) directive, which
appends the whole URI and is not affected.
### auth_delay
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `auth_delay` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| Default | `auth_delay 0s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Delays processing of unauthorized requests with 401 response code to prevent
timing attacks when access is limited by [password](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_basic.md#http-auth-basic) or by
the [result of subrequest](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#http-auth-request).
### auto_redirect
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `auto_redirect` [`on` | `off` | `default`]; |
|------------------------------------------------------------------------------------------|-----------------------------------------------|
| Default | `auto_redirect default;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Controls the [redirection](#location-redirect) behavior
when a prefix location ends with a slash:
```nginx
location /prefix/ {
auto_redirect on;
}
```
Here, a request for `/prefix` causes a redirect to `/prefix/`.
The value `on` explicitly enables redirection,
while `off` disables it.
When set to `default`, redirection is enabled only
if the location processes requests with [api](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#a-api), [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass),
[fastcgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-pass), [uwsgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#uwsgi-pass), [scgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#scgi-pass), [memcached_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_memcached.md#memcached-pass),
or [grpc_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_grpc.md#grpc-pass).
### chunked_transfer_encoding
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `chunked_transfer_encoding` `on` | `off`; |
|------------------------------------------------------------------------------------------|---------------------------------------------|
| Default | `chunked_transfer_encoding on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Allows disabling chunked transfer encoding in HTTP/1.1. It may come in handy when using a software failing to support chunked encoding despite the standard's requirement.
### client
#### Versionadded
Added in version 1.10.0.
#### Versionchanged
Changed in version 1.10.1.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client` { ... } |
|------------------------------------------------------------------------------------------|--------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Creates a special `client` context for processing internal HTTP requests
that Angie performs on its own without external client involvement.
The `client` context isolates service traffic
from various Angie modules from user traffic,
allowing additional control over it.
Within this context, only named locations
(with the `@` prefix) can be defined;
they are not accessible for external HTTP requests
and can only be called programmatically through internal server mechanisms.
The `client` context is used for:
- sending requests to the certificate authority in the [ACME](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#http-acme) module
via the predefined `location @acme`,
which can be additionally configured
using directives from the [Proxy](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#http-proxy) module;
- requests to the Docker API in the [Docker](https://en.angie.software//angie/docs/configuration/modules/http/http_docker.md#http-docker) module
via the predefined `location @docker_events`
and `@docker_containers`,
which can be additionally configured
using directives from the [Proxy](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#http-proxy) module;
- health probes of proxied servers via [upstream_probe (PRO)](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream_probe.md#u-upstream-probe);
- [sticky learn](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-sticky) mode with `remote_action`
in the Stream [Upstream](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#stream-upstream) module.
Support for multiple `client` blocks
allows grouping common settings for multiple `location` blocks
within each block,
which helps avoid configuration duplication.
Directives specified in each `client` block
are inherited only by `location` blocks explicitly declared within it.
In particular, this is why they do not affect the configuration of other modules
that implicitly use the `client` block for outgoing requests
(for example, [ACME](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#http-acme) or [Docker](https://en.angie.software//angie/docs/configuration/modules/http/http_docker.md#http-docker)).
Example of using multiple `client` blocks
with settings inheritance:
```nginx
client {
proxy_set_header Host docker.example.com;
proxy_set_header Authorization "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==";
location @docker_events {
}
location @docker_containers {
}
}
client {
proxy_method GET;
proxy_set_header Host backend.example.com;
proxy_set_header X-Real-IP $remote_addr;
location @health_check {
proxy_pass http://upstream-server/health;
}
}
```
#### NOTE
The same directives are allowed here as in regular `location` blocks,
but only content handlers
(such as [js_content](https://en.angie.software//angie/docs/configuration/modules/external-modules/http_js.md#js-content) or [autoindex](https://en.angie.software//angie/docs/configuration/modules/http/http_autoindex.md#id1))
and variable handlers (such as [map](https://en.angie.software//angie/docs/configuration/modules/http/http_map.md#id1)),
as well as directives that generate requests themselves,
like `upstream_probe`, actually work.
Directives that operate at other
[request processing stages](https://en.angie.software//angie/docs/configuration/processing.md#http-sessions)
(such as [limit_req](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#limit-req), [auth_request](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#id1),
[try_files](#try-files), image filters, XSLT, etc.)
do not work here.
### client_body_buffer_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client_body_buffer_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| Default | `client_body_buffer_size 8k|16k;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the buffer size for reading the client request body. If the request body is larger than the buffer, the whole body or only its part is written to a [temporary file](#client-body-temp-path). By default, the buffer size is equal to two memory pages. On x86, other 32-bit platforms, and x86-64, this is 8K. On other 64-bit platforms, it is usually 16K.
### client_body_in_file_only
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client_body_in_file_only` `on` | `clean` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------------------------|
| Default | `client_body_in_file_only off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Determines whether to save the entire client request body to a file. This directive can be used during debugging, or when using the [$request_body_file](#v-request-body-file) variable, or the [$r->request_body_file](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#p-r-request-body-file) method of the [Perl](https://en.angie.software//angie/docs/configuration/modules/http/http_perl.md#http-perl) module.
| `on` | temporary files are not removed after request processing |
|---------|------------------------------------------------------------------------|
| `clean` | allows the temporary files left after request processing to be removed |
### client_body_in_single_buffer
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client_body_in_single_buffer` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------------------|
| Default | `client_body_in_single_buffer off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Determines whether to save the entire client request body in a single buffer. The directive is recommended when using the [$request_body](#v-request-body) variable to reduce the number of copy operations involved.
### client_body_temp_path
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client_body_temp_path` path [level1 [level2 [level3]]]; |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Default | `client_body_temp_path client_body_temp;` (the path depends on the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#paths) `--http-client-body-temp-path`) |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Defines a directory for storing temporary files with client request bodies. Up to three-level subdirectory hierarchy can be used under the specified directory. For example, in the following configuration
```nginx
client_body_temp_path /spool/angie/client_temp 1 2;
```
a path to a temporary file might look like this:
```nginx
/spool/angie/client_temp/7/45/00000123457
```
### client_body_timeout
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client_body_timeout` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
| Default | `client_body_timeout 60s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Defines a timeout for reading client request body. The timeout is set only for a period between two successive read operations, not for the transmission of the whole request body. If a client does not transmit anything within this time, the request is terminated with the 408 (Request Time-out) error.
### client_header_buffer_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client_header_buffer_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| Default | `client_header_buffer_size 1k;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server |
Sets buffer size for reading client request header. For most requests, a buffer of 1K bytes is enough. However, if a request includes long cookies, or comes from a WAP client, it may not fit into 1K. If a request line or a request header field does not fit into this buffer then larger buffers, configured by the [large_client_header_buffers](#large-client-header-buffers) directive, are allocated.
If the directive is specified on the [server](#server) level, the value from the default server can be used. See the [Virtual server selection](https://en.angie.software//angie/docs/configuration/processing.md#request-processing) section for details.
### client_header_timeout
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client_header_timeout` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| Default | `client_header_timeout 60s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server |
Defines a timeout for reading client request header. If a client does not transmit the entire header within this time, the request is terminated with the 408 (Request Time-out) error.
### client_max_body_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `client_max_body_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| Default | `client_max_body_size 1m;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the maximum allowed size of the client request body. If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client. Please be aware that browsers cannot correctly display this error.
| `0` | disables checking of client request body size |
|-------|-------------------------------------------------|
### connection_pool_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `connection_pool_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| Default | `connection_pool_size 256` | `512;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Allows accurate tuning of per-connection memory allocations. This directive has minimal impact on performance and should not generally be used. By default:
| `256` (bytes) | on 32-bit platforms |
|-----------------|-----------------------|
| `512` (bytes) | on 64-bit platforms |
### default_type
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `default_type` mime-type; |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default | `default_type text/plain;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Defines the default MIME type of a response. Mapping of file name extensions to MIME types can be set with the [types](#types) directive.
### directio
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `directio` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units) | `off`; |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| Default | `directio off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables the use of the `O_DIRECT` flag (FreeBSD, Linux), the `F_NOCACHE` flag (macOS), or the `directio()` function (Solaris), when reading files that are larger than or equal to the specified size. The directive automatically disables the use of [sendfile](#sendfile) for a given request. It is recommended for serving large files:
```nginx
directio 4m;
```
or when using [aio](#aio) on Linux.
### directio_alignment
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `directio_alignment` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| Default | `directio_alignment 512;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the alignment for [directio](#directio). In most cases, a 512-byte alignment is enough. However, when using XFS under Linux, it needs to be increased to 4K.
### disable_symlinks
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `disable_symlinks` `off`;
`disable_symlinks` `on` | `if_not_owner` [`from=`part]; |
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| Default | `disable_symlinks off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Determines how symbolic links should be treated when opening files:
| `off` | Symbolic links in the path are allowed and not checked. This is the default behavior. |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `on` | If any component of the path is a symbolic link, access to the file is denied. |
| `if_not_owner` | Access to the file is denied if any component of the path is a symbolic link, and the link and the object it points to have different owners. |
| `from=`part | When checking symbolic links (parameters `on` and `if_not_owner`), all path components are usually checked. It is possible to skip checking symbolic links in the initial part of the path by additionally specifying the `from=part` parameter. In this case, symbolic links are checked only starting from the path component that follows the specified initial part. If the value is not an initial part of the checked path, the path is checked entirely, as if this parameter were not specified at all. If the value completely matches the file name, symbolic links are not checked. The parameter value can contain variables. |
Example:
```nginx
disable_symlinks on from=$document_root;
```
This directive is only available on systems that have the `openat()` and `fstatat()` interfaces. Such systems include modern versions of FreeBSD, Linux, and Solaris.
#### WARNING
The `on` and `if_not_owner` parameters add processing overhead.
On systems that do not support opening directories for search only, using these parameters requires worker processes to have read permissions for all directories being checked.
#### NOTE
The [AutoIndex](https://en.angie.software//angie/docs/configuration/modules/http/http_autoindex.md#http-autoindex), [Random Index](https://en.angie.software//angie/docs/configuration/modules/http/http_random_index.md#http-random-index), and [DAV](https://en.angie.software//angie/docs/configuration/modules/http/http_dav.md#http-dav) modules currently ignore this directive.
### early_hints
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `early_hints` string ...; |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Defines conditions under which the "103 Early Hints" response will be passed to a client. The response can be returned by proxied and gRPC backends. If at least one value of the string parameters is not empty and is not equal to `0` then the response will be passed:
```nginx
map $http_sec_fetch_mode $early_hints {
navigate $http2$http3;
}
server {
...
location / {
early_hints $early_hints;
proxy_pass http://example.com;
}
}
```
Parameter values can contain variables.
### error_log_user_tag
#### Versionadded
Added in version 1.12.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `error_log_user_tag` value; |
|------------------------------------------------------------------------------------------|--------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, limit_except |
Adds a request-specific tag to [error_log](https://en.angie.software//angie/docs/configuration/modules/core.md#error-log) records. The value can
[contain variables](https://en.angie.software//angie/docs/configuration/configfile.md#string-variables). The directive can be specified
multiple times to add multiple tags. Tags can be matched with
`filter=tag:` in [error_log](https://en.angie.software//angie/docs/configuration/modules/core.md#error-log).
### error_page
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `error_page` code ... [=[response]] uri; |
|------------------------------------------------------------------------------------------|--------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, if in location |
Defines the URI that will be shown for the specified errors. The uri value can contain variables.
Example:
```nginx
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
```
This causes an internal redirect to the specified uri with the client request method changed to "GET" (for all methods other than "GET" and "HEAD").
Furthermore, it is possible to change the response code to another using the syntax like `=response`, for example:
```nginx
error_page 404 =200 /empty.gif;
```
If an error response is processed by a proxied server or a FastCGI/uwsgi/SCGI/gRPC server, and the server may return different response codes (e.g., 200, 302, 401, or 404), it is possible to pass the code it returns:
```nginx
error_page 404 = /404.php;
```
If there is no need to change the URI and method during internal redirect, it is possible to pass error processing into a named `location`:
```nginx
location / {
error_page 404 = @fallback;
}
location @fallback {
proxy_pass http://backend;
}
```
#### NOTE
If an error occurs during the processing of uri, the response with the code of the last occurred error is returned to the client.
It is also possible to use URL redirects for error processing:
```nginx
error_page 403 http://example.com/forbidden.html;
error_page 404 =301 http://example.com/notfound.html;
```
In this case, by default, the response code 302 is returned to the client. It can only be changed to one of the redirect response codes (301, 302, 303, 307, and 308).
### etag
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `etag` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------|
| Default | `etag on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables automatic generation of the `ETag` response header field for static resources.
### http
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `http` { ... } |
|------------------------------------------------------------------------------------------|------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | main |
Provides the configuration file context in which the HTTP server directives are specified.
### if_modified_since
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `if_modified_since` `off` | `exact` | `before`; |
|------------------------------------------------------------------------------------------|---------------------------------------------------|
| Default | `if_modified_since exact;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Specifies how to compare modification time of a response with the time in the `If-Modified-Since` request header field:
| `off` | the response is always considered modified |
|----------|---------------------------------------------------------------------------------------------------------------------|
| `exact` | exact match |
| `before` | modification time of the response is less than or equal to the time in the `If-Modified-Since` request header field |
### ignore_invalid_headers
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `ignore_invalid_headers` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------------|
| Default | `ignore_invalid_headers on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server |
Controls whether Angie ignores header fields with invalid names. Valid names are composed of English letters, digits, hyphens, and possibly underscores (as controlled by the [underscores_in_headers](#underscores-in-headers) directive).
If the directive is specified on the [server](#server) level, the value from the default server can be used.
### internal
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `internal;` |
|------------------------------------------------------------------------------------------|---------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | location |
Specifies that a given `location` can only be used for internal requests. For external requests, the client error 404 (Not Found) is returned. Internal requests are the following:
* requests redirected by the [error_page](#error-page), [index](https://en.angie.software//angie/docs/configuration/modules/http/http_index.md#id1), [random_index](https://en.angie.software//angie/docs/configuration/modules/http/http_random_index.md#id1), and [try_files](#try-files) directives;
* requests redirected by the `X-Accel-Redirect` response header field from an upstream server;
* subrequests formed by the `include virtual` command of the [SSI](https://en.angie.software//angie/docs/configuration/modules/http/http_ssi.md#http-ssi) module, by the [Addition](https://en.angie.software//angie/docs/configuration/modules/http/http_addition.md#http-addition) module directives, and by [auth_request](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#id1) and [mirror](https://en.angie.software//angie/docs/configuration/modules/http/http_mirror.md#id1) directives;
* requests changed by the [rewrite](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#id5) directive;
* requests redirected by the [goto](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#goto) directive.
Example:
```nginx
error_page 404 /404.html;
location = /404.html {
internal;
}
```
Because the 404 error is returned in the context of a `location` with the `internal` directive, external requests can be redirected to a different location. This allows using the same prefix for both external and internal requests, but with different processing, for example:
```nginx
location /path {
internal;
error_page 404 =@external;
proxy_pass https://internal;
}
location @external {
proxy_pass https://external;
}
```
Here, an external request `GET /path` will be proxied to
`https://external/path`, while the same internal request will be proxied to
`https://internal/path`.
#### NOTE
To prevent looping that can occur with incorrect configurations, the number of internal redirects is limited to ten. When this limit is reached, the 500 (Internal Server Error) error is returned. In such cases, the `rewrite or internal redirection cycle` message can be seen in the error log.
### keepalive_disable
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `keepalive_disable` `none` | browser ...; |
|------------------------------------------------------------------------------------------|---------------------------------------------|
| Default | `keepalive_disable msie6;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Disables keep-alive connections with misbehaving browsers. The browser parameters specify which browsers will be affected.
| `none` | enables keep-alive connections with all browsers |
|----------|----------------------------------------------------------------------------------------------------------------|
| `msie6` | disables keep-alive connections with old versions of MSIE, once a POST request is received |
| `safari` | disables keep-alive connections with Safari and Safari-like browsers on macOS and macOS-like operating systems |
### keepalive_requests
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `keepalive_requests` number; |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default | `keepalive_requests 1000;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the maximum number of requests that can be served through one keep-alive connection. After the maximum number of requests are made, the connection is closed.
Periodic closing of connections is necessary to free per-connection memory allocations. Therefore, using too high maximum number of requests could result in excessive memory usage and is not recommended.
### keepalive_time
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `keepalive_time` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| Default | `keepalive_time 1h;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Limits the maximum time during which requests can be processed through one keep-alive connection. After this time is reached, the connection is closed following the subsequent request processing.
### keepalive_timeout
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `keepalive_timeout` timeout [header_timeout]; |
|------------------------------------------------------------------------------------------|-------------------------------------------------|
| Default | `keepalive_timeout 75s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
| timeout | sets a timeout during which a keep-alive client connection will stay open on the server side |
|-----------|------------------------------------------------------------------------------------------------|
| `0` | disables keep-alive client connections |
The second, *optional*, parameter sets a value in the `Keep‑Alive: timeout=time` header field in the response. The two parameters may differ.
The `Keep-Alive: timeout=time` header field is recognized by Mozilla and Konqueror. MSIE closes keep-alive connections by itself in about 60 seconds.
#### NOTE
This directive applies to client connections. The timeout for idle
connections to proxied upstream servers is set separately by
[keepalive_timeout](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-keepalive-timeout) in the upstream block.
### large_client_header_buffers
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `large_client_header_buffers` number size; |
|------------------------------------------------------------------------------------------|----------------------------------------------|
| Default | `large_client_header_buffers 4 8k;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server |
Sets the maximum number and size of buffers used for reading large client request header. A request line cannot exceed the size of one buffer, or the 414 (Request-URI Too Large) error is returned to the client. A request header field cannot exceed the size of one buffer as well, or the 400 (Bad Request) error is returned to the client. Buffers are allocated only on demand. By default, the buffer size is equal to 8K bytes. If after the end of request processing a connection is transitioned into the keep-alive state, these buffers are released.
If the directive is specified on the [server](#server) level, the value from the default server can be used.
### limit_except
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `limit_except` method1 [method2...] { ... }; |
|------------------------------------------------------------------------------------------|------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | location |
Limits allowed HTTP methods inside a location. The method parameter can be one of the
following: `GET`, `HEAD`, `POST`, `PUT`, `DELETE`,
`MKCOL`, `COPY`, `MOVE`, `OPTIONS`, `PROPFIND`,
`PROPPATCH`, `LOCK`, `UNLOCK`, or `PATCH`. Allowing the
`GET` method makes the `HEAD` method also allowed. Access to other methods
can be limited using the [Access](https://en.angie.software//angie/docs/configuration/modules/http/http_access.md#http-access) and
[Auth Basic](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_basic.md#http-auth-basic) module directives:
```nginx
limit_except GET {
allow 192.168.1.0/32;
deny all;
}
```
#### NOTE
The restriction in this example applies to all methods
**except** `GET` and `HEAD`.
### limit_rate
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `limit_rate` rate; |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default | `limit_rate 0;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, if in location |
Limits the rate of response transmission to a client. The rate is specified in bytes per second. The zero value disables rate limiting. The limit is set per a request, and so if a client simultaneously opens two connections, the overall rate will be twice as much as the specified limit.
Parameter value can contain variables. It may be useful in cases where rate should be limited depending on a certain condition:
```nginx
map $slow $rate {
1 4k;
2 8k;
}
limit_rate $rate;
```
Rate limit can also be set in the [$limit_rate](#v-limit-rate) variable, however, this method is not recommended:
```nginx
server {
if ($slow) {
set $limit_rate 4k;
}
}
```
Rate limit can also be set in the `X-Accel-Limit-Rate` header field of a proxied server response. This capability can be disabled using the [proxy_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-ignore-headers), [fastcgi_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-ignore-headers), [uwsgi_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#uwsgi-ignore-headers), and [scgi_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#scgi-ignore-headers) directives.
### limit_rate_after
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `limit_rate_after` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| Default | `limit_rate_after 0;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, if in location |
Sets the initial amount after which the further transmission of a response to a client will be rate limited. Parameter value can contain variables.
Example:
```nginx
location /flv/ {
flv;
limit_rate_after 500k;
limit_rate 50k;
}
```
### lingering_close
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `lingering_close` `on` | `always` | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------------------|
| Default | `lingering_close on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Controls how Angie closes client connections.
| `on` | Angie will [wait for](#lingering-timeout) and [process](#lingering-time) additional data from a client before fully closing a connection, but only if heuristics suggests that a client may be sending more data. |
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `always` | Angie will always wait for and process additional client data. |
| `off` | Angie will not wait for more data and will close the connection immediately. This behavior breaks the protocol and should not be used under normal circumstances. |
To control closing of HTTP/2 connections, the directive must be specified at the [server](#server) level.
### lingering_time
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `lingering_time` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| Default | `lingering_time 30s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
When [lingering_close](#lingering-close) is in effect, this directive specifies the maximum time during which Angie will process (read and ignore) additional data coming from a client. After that, the connection will be closed, even if there will be more data.
### lingering_timeout
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `lingering_timeout` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| Default | `lingering_timeout 5s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
When [lingering_close](#lingering-close) is in effect, this directive specifies the maximum
waiting time for more client data to arrive. If data are not received during
this time, the connection is closed. Otherwise, the data are read and ignored,
and Angie starts waiting for more data again. The "wait-read-ignore" cycle is
repeated, but no longer than specified by the [lingering_time](#lingering-time) directive.
During graceful shutdown, client keepalive connections are closed only when
they have been idle for at least the time specified in `lingering_timeout`.
#### NOTE
In nginx, the analogous directive is called [keepalive_min_timeout](https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_min_timeout).
### listen
#### Versionchanged
Changed in version 1.10.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `listen` address[:port] [`default_server`] [`ssl`] [http2 | `quic`] [`proxy_protocol`] [`setfib=`number] [`fastopen=`number] [`backlog=`number] [`rcvbuf=`size] [`sndbuf=`size] [`accept_filter=`filter] [`deferred`] [`bind`] [`ipv6only=``on` | `off`] [`reuseport`] [`so_keepalive=`on|off|[`keepidle`]:[`keepintvl`]:[`keepcnt`]];
`listen` unix:path [`default_server`] [`ssl`] [http2 | `quic`] [`proxy_protocol`] [`backlog=`number] [`rcvbuf=`size] [`sndbuf=`size] [`accept_filter=`filter] [`deferred`] [`bind`] [`so_keepalive=`on|off|[`keepidle`]:[`keepintvl`]:[`keepcnt`]]; |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Default | `listen *:80` | `*:8000;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | server |
Sets the address and port for the listening socket, or the path for a UNIX domain
socket on which the server will accept requests. An address may also be a
hostname, for example:
```nginx
listen 127.0.0.1:8000;
listen 127.0.0.1;
listen 8000;
listen *:8000;
listen localhost:8000;
```
IPv6 addresses are specified in square brackets:
```nginx
listen [::]:8000;
listen [::1];
```
Port ranges are specified with the first and last port separated by a hyphen:
```nginx
listen 127.0.0.1:8000-8009;
listen 8000-8009;
```
UNIX domain sockets are specified with the `unix:` prefix:
```nginx
listen unix:/var/run/angie.sock;
```
Both address and port, or only address or only port, can be specified.
When some parts are omitted, the following rules apply:
- If only the address is given, port 80 is used.
- If only the port is given,
Angie listens on all available IPv4 (and IPv6, if enabled) interfaces.
The first `server` block for that port
becomes the default server for requests with an unmatched `Host` header.
- If the directive is omitted entirely, Angie uses `*:80`
when running with superuser privileges or `*:8000` otherwise.
| `default_server` | The server with this parameter specified will be the default server for the given address:port pair (together they form a *listening socket*).
If there are no directives with the `default_server` parameter, the default server for the listening socket will be the first server in the configuration that serves this socket. |
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ssl` | indicates that all connections accepted on this listening socket should work in SSL mode. This allows for a more [compact configuration](https://en.angie.software//angie/docs/configuration/ssl.md#compact-server) for the server that handles both HTTP and HTTPS requests. |
| `http2` | configures the port to accept HTTP/2 connections. Normally, for this to work the `ssl` parameter should be specified as well, but Angie can also be configured to accept HTTP/2 connections without SSL.
#### Deprecated Deprecated since version 1.2.0: Use the [http2](https://en.angie.software//angie/docs/configuration/modules/http/http_v2.md#http2) directive instead. |
| `quic` | configures the port to accept QUIC connections. To use this option, Angie must have the [HTTP/3](https://en.angie.software//angie/docs/configuration/modules/http/http_v3.md#http-v3) module enabled and configured. With `quic` set, you can also specify `reuseport` so multiple worker processes can be used. |
| `proxy_protocol` | indicates that all connections accepted on this listening socket should use the PROXY protocol. |
The `listen` directive can also specify several additional parameters specific to socket-related system calls. These parameters can be specified in any `listen` directive, but only once for a given listening socket:
| `setfib=`number | sets the routing table, FIB (the `SO_SETFIB` option) for the listening socket. This currently works only on FreeBSD. |
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fastopen=`number | enables "TCP Fast Open" for the listening socket and limits the maximum length for the queue of connections that have not yet completed the three-way handshake.
#### WARNING Do not enable "TCP Fast Open" unless the server can handle receiving the same SYN packet with data more than once. |
| `backlog=`number | sets the `backlog` parameter in the `listen()` call that limits the maximum length for the queue of pending connections. By default, backlog is set to -1 on FreeBSD, DragonFly BSD, and macOS, and to 511 on other platforms. |
| `rcvbuf=`size | sets the receive buffer size (the `SO_RCVBUF` option) for the listening socket. |
| `sndbuf=`size | sets the send buffer size (the `SO_SNDBUF` option) for the listening socket. |
| `accept_filter=`filter | sets the name of accept filter (the `SO_ACCEPTFILTER` option) for the listening socket that filters incoming connections before passing them to `accept()`. This works only on FreeBSD and NetBSD 5.0+. Possible values are `dataready` and `httpready`. |
| `deferred` | instructs to use a deferred `accept()` (the `TCP_DEFER_ACCEPT` socket option) on Linux. |
| `bind` | instructs to make a separate `bind()` call for a given address:port pair. This is useful because if there are several `listen` directives with the same port but different addresses, and one of the `listen` directives listens on all addresses for the given `port` (`*:port`), Angie will `bind()` only to `*:port`. It should be noted that the `getsockname()` system call will be made in this case to determine the address that accepted the connection. If the `setfib`, `fastopen`, `backlog`, `rcvbuf`, `sndbuf`, `accept_filter`, `deferred`, `ipv6only`, `reuseport` or `so_keepalive` parameters are used then for a given `address:port` pair a separate `bind()` call will always be made. |
| `ipv6only=on` | `off` | determines (via the `IPV6_V6ONLY` socket option) whether an IPv6 socket listening on a wildcard address [::] will accept only IPv6 connections or both IPv6 and IPv4 connections. This parameter is turned on by default. It can only be set once on start. |
| `reuseport` | instructs to create an individual listening socket for each worker process (using the `SO_REUSEPORT` socket option on Linux 3.9+ and DragonFly BSD, or `SO_REUSEPORT_LB` on FreeBSD 12+), allowing a kernel to distribute incoming connections between worker processes. This currently works only on Linux 3.9+, DragonFly BSD, and FreeBSD 12+.
#### WARNING Inappropriate use of the `reuseport` parameter may have security implications. |
| `multipath` | enables accepting connections via [Multipath TCP](https://en.wikipedia.org/wiki/Multipath_TCP) (MPTCP), supported in the Linux kernel since version 5.6. This parameter is **incompatible** with `quic`. |
| `so_keepalive=on` | `off` | [`keepidle`]:[`keepintvl`]:[`keepcnt`] | configures the "TCP keepalive" behavior for the listening socket.
| `''` | if this parameter is omitted then the operating system's settings will be in effect for the socket | |--------|------------------------------------------------------------------------------------------------------| | `on` | the `SO_KEEPALIVE` option is turned on for the socket | | `off` | the `SO_KEEPALIVE` option is turned off for the socket | |
Some operating systems support setting of TCP keepalive parameters on a
per-socket basis using the `TCP_KEEPIDLE`, `TCP_KEEPINTVL`, and
`TCP_KEEPCNT` socket options. On such systems (currently, Linux, NetBSD,
Dragonfly, FreeBSD, and macOS), they can be configured using the
`keepidle`, `keepintvl`, and `keepcnt` parameters. One or two
parameters may be omitted, in which case the system default setting for the
corresponding socket option will be in effect. For example,
```nginx
so_keepalive=30m::10
```
will set the idle timeout (`TCP_KEEPIDLE`) to 30 minutes, leave the probe interval (`TCP_KEEPINTVL`) at its system default, and set the probes count (`TCP_KEEPCNT`) to 10 probes.
Example:
```nginx
listen 127.0.0.1 default_server accept_filter=dataready backlog=1024;
```
### location
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `location` ([ = | ~ | ~\* | ^~ ] uri | `@name`)+ { ... } |
|------------------------------------------------------------------------------------------|------------------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | server, location |
Sets the configuration depending on whether the request URI matches
any of the matching expressions.
The matching is performed against the normalized request URI (the value of
[$uri](#v-uri)), after decoding the text
encoded in the "%XX" form, resolving references to relative path components "."
and "..", and possible [compression](#merge-slashes) of two or more
adjacent slashes into a single slash.
A `location` can either be defined by a prefix string, or by a regular
expression.
Regular expressions are specified with the preceding modifier:
| `~*` | Case-insensitive matching |
|--------|-----------------------------|
| `~` | Case-sensitive matching |
To find a location that matches a request, Angie first checks the
locations defined with prefix strings (prefix locations). Among them, the location
with the longest matching prefix is selected and remembered.
#### NOTE
For case-insensitive operating systems such as macOS, prefix string matching
is case insensitive.
However, matching is limited to single-byte locales.
Then regular expressions are checked in the order of their appearance in the
configuration file. The search stops after the first match, and the corresponding
configuration is used. If no match with a regular expression is found, then the
configuration of the prefix location remembered earlier is used.
With some exceptions mentioned below,
`location` blocks can be nested.
Regular expressions can create capture groups
that can later be used with other directives.
If the longest matching prefix location has the `^~` modifier,
then regular expressions are not checked.
Also, using the `=` modifier, it is possible to define an exact match of URI and
location. If an exact match is found, the search terminates. For example, if a
`/` request happens frequently, defining `location =/` will speed up
the processing of these requests, as the search terminates after the first comparison.
Such a location cannot contain nested locations, as it defines an exact match.
Once a matching `location` is selected, the request is mapped to a file
through the [root](#root) or [alias](#alias) directive, and [try_files](#try-files) can
probe for files within it; see [Choosing locations](https://en.angie.software//angie/docs/configuration/processing.md#pick-location) for an overview.
Example:
```nginx
location =/ {
#configuration A
}
location / {
#configuration B
}
location /documents/ {
#configuration C
}
location ^~/images/ {
#configuration D
}
location ~*\.(gif|jpg|jpeg)$ {
#configuration E
}
```
- A `/` request will match configuration A,
- an `/index.html` request will match configuration B,
- a `/documents/document.html` request will match configuration C,
- an `/images/1.gif` request will match configuration D,
- and a `/documents/1.jpg` request will match configuration E.
#### NOTE
If a prefix `location` ends with a slash character and
[auto_redirect](#auto-redirect) is enabled, the following occurs:
When a request arrives with a URI that has no trailing slash
but otherwise matches the prefix exactly, a permanent redirect
with code 301 is returned, pointing to the requested URI with a slash appended.
With an exact URI-matching location, redirection isn't applied:
```nginx
location /user/ {
proxy_pass http://user.example.com;
}
location =/user {
proxy_pass http://login.example.com;
}
```
The `@` prefix defines a *named* `location`. Such locations aren't used for regular request processing,
but instead are only intended for request redirection.
They cannot be nested and cannot contain nested locations.
#### Combined locations
Several `location` contexts that define identical configuration blocks
can be compacted by listing all their matching expressions in a single
`location` with a single configuration block.
That's called a *combined* `location`.
Suppose that configurations A, D, and E from the previous example
define identical configurations; you can combine them into one `location`:
```nginx
location =/
^~/images/
~*\.(gif|jpg|jpeg)$ {
# general configuration
}
```
A named `location` can also be a part of the combination:
```nginx
location =/
@named_combined {
#...
}
```
#### WARNING
A combined `location` can't have a space between the matching expression
modifier and the expression itself.
Proper form: `location ~*/match(ing|es|er)$ *...*`.
#### NOTE
Currently, a combined `location` cannot **immediately** contain
`proxy_pass` directives with URI set, nor `api` or `alias`.
However, these directives can be used by locations nested
inside a combined location.
### log_not_found
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `log_not_found` `on` | `off`; |
|------------------------------------------------------------------------------------------|---------------------------------|
| Default | `log_not_found on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables logging of errors about not found files into [error_log](https://en.angie.software//angie/docs/configuration/modules/core.md#error-log).
### log_subrequest
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `log_subrequest` `on` | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------|
| Default | `log_subrequest off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables logging of subrequests into [access_log](https://en.angie.software//angie/docs/configuration/modules/http/http_log.md#access-log).
### max_headers
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `max_headers` number; |
|------------------------------------------------------------------------------------------|-------------------------|
| Default | `max_headers 1000;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server |
Sets the maximum number of client request header fields allowed.
If this limit is exceeded, a `400 (Bad Request)` error is returned.
When this directive is set at the [server](#server) level,
the value from the default server may be applied.
For more information, refer to the [Virtual server selection](https://en.angie.software//angie/docs/configuration/processing.md#virtual-server-selection) section.
### max_ranges
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `max_ranges` number; |
|------------------------------------------------------------------------------------------|------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Limits the maximum allowed number of ranges in byte-range requests. Requests that exceed the limit are processed as if there were no byte ranges specified. By default, the number of ranges is not limited.
| `0` | disables the byte-range support completely |
|-------|----------------------------------------------|
### merge_slashes
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `merge_slashes` `on` | `off`; |
|------------------------------------------------------------------------------------------|---------------------------------|
| Default | `merge_slashes on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server |
Enables or disables compression of two or more adjacent slashes in a URI into a single slash.
Note that compression is essential for the correct matching of prefix string and regular expression locations. Without it, the `//scripts/one.php` request would not match
```nginx
location /scripts/ { }
```
and might be processed as a static file. So it gets converted to `/scripts/one.php`.
Turning the compression off can become necessary if a URI contains base64-encoded names, since base64 uses the "/" character internally. However, for security considerations, it is better to avoid turning the compression off.
If the directive is specified on the [server](#server) level, the value from the default server can be used.
### msie_padding
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `msie_padding` `on` | `off`; |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default | `msie_padding on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables adding comments to responses for MSIE clients with status greater than 400 to increase the response size to 512 bytes.
### msie_refresh
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `msie_refresh` `on` | `off`; |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default | `msie_refresh off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables issuing refreshes instead of redirects for MSIE clients.
### open_file_cache
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `open_file_cache` `off`;
`open_file_cache` `max=`N [`inactive=`time]; |
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| Default | `open_file_cache off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Configures a cache that can store:
* open file descriptors, their sizes and modification times;
* information on existence of directories;
* file lookup errors, such as "file not found", "no read permission", and so on.
Caching of errors should be enabled separately by the [open_file_cache_errors](#open-file-cache-errors) directive.
| `max` | sets the maximum number of elements in the cache; on cache overflow the least recently used (LRU) elements are removed |
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| `inactive` | defines a time after which an element is removed from the cache if it has not been accessed during this time;
by default, 60 seconds |
| `off` | disables the cache |
Example:
```nginx
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
```
### open_file_cache_errors
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `open_file_cache_errors` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------------|
| Default | `open_file_cache_errors off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables caching of file lookup errors by [open_file_cache](#open-file-cache).
### open_file_cache_events
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `open_file_cache_events` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------------|
| Default | `open_file_cache_events off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables the use of kernel events to validate [open_file_cache](#open-file-cache) elements. This directive works with the [kqueue](https://en.angie.software//angie/docs/configuration/processing.md#kqueue) method only. Note that only NetBSD 2.0+ and FreeBSD 6.0+ support events for arbitrary file system types; other operating systems support events only for essential file systems such as UFS or FFS.
### open_file_cache_min_uses
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `open_file_cache_min_uses` number; |
|------------------------------------------------------------------------------------------|--------------------------------------|
| Default | `open_file_cache_min_uses 1;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the minimum number of file accesses during the period configured by the `inactive` parameter of the [open_file_cache](#open-file-cache) directive, required for a file descriptor to remain open in the cache.
### open_file_cache_valid
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `open_file_cache_valid` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| Default | `open_file_cache_valid 60s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets a time after which [open_file_cache](#open-file-cache) elements should be validated.
### output_buffers
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `output_buffers` number [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| Default | `output_buffers 2 32k;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the number and size of the buffers used for reading a response from a disk.
### port_in_redirect
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `port_in_redirect` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------|
| Default | `port_in_redirect on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables specifying the port in [absolute](#absolute-redirect) redirects issued by Angie.
The use of the primary server name in redirects is controlled by the [server_name_in_redirect](#server-name-in-redirect) directive.
### postpone_output
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `postpone_output` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| Default | `postpone_output 1460;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
If possible, the transmission of client data will be postponed until Angie has at least the specified number of bytes to send.
| `0` | disables postponing data transmission |
|-------|-----------------------------------------|
### read_ahead
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `read_ahead` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| Default | `read_ahead 0;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the amount of pre-reading for the kernel when working with files.
On Linux, the `posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL)` system call is used, and so the size parameter is ignored.
On FreeBSD, the `fcntl(O_READAHEAD,` size ) system call, supported since FreeBSD 9.0-CURRENT, is used.
### recursive_error_pages
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `recursive_error_pages` `on` | `off`; |
|------------------------------------------------------------------------------------------|-----------------------------------------|
| Default | `recursive_error_pages off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables doing several redirects using the [error_page](#error-page) directive. The number of such redirects is [limited](#internal).
### request_pool_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `request_pool_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| Default | `request_pool_size 4k;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server |
Allows accurate tuning of per-request memory allocations. This directive has minimal impact on performance and should not generally be used.
### reset_timedout_connection
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `reset_timedout_connection` `on` | `off`; |
|------------------------------------------------------------------------------------------|---------------------------------------------|
| Default | `reset_timedout_connection off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables resetting timed-out connections and connections closed with the non-standard code 444. The reset is performed as follows. Before closing a socket, the `SO_LINGER` option is set for it with a timeout value of 0. When the socket is closed, TCP RST is sent to the client, and all memory associated with this socket is released. This helps avoid keeping an already closed socket in the FIN_WAIT1 state with filled buffers for a long time.
#### NOTE
keep-alive connections are closed normally when they time out.
### resolver
#### Versionchanged
Changed in version 1.12.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `resolver` [address ...] [`conf` [`=`file]] [`valid=`time] [`ipv4=``on` | `off`] [`ipv6=``on` | `off`] [`status_zone=`zone];
`resolver` `off`; |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| Default | `resolver conf;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, upstream |
Configures name servers used to resolve names of upstream servers into addresses, for example:
```nginx
resolver 127.0.0.53 [::1]:5353;
```
The address can be specified as a domain name or IP address, with an optional port. If port is not specified, the port 53 is used. Name servers are queried in a round-robin fashion.
At least one DNS server address or the `conf` parameter must be specified,
except in the `resolver off;` form.
#### NOTE
Prefer a local trusted resolver such as `127.0.0.53` (systemd-resolved)
over a public one (e.g. `8.8.8.8`). Public resolvers expose DNS queries
to third parties and increase susceptibility to cache-poisoning attacks.
#### NOTE
The directive value is inherited by nested blocks
and can be overridden in them if necessary.
Within a single block the directive may be specified only once;
repeating it is a configuration error.
Enables DNS resolution for upstream servers referenced through variables or
configured with the [resolve](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#reresolve) parameter, and for the ACME
client and OCSP stapling.
Besides explicit server addresses, the directive recognizes:
| `off` | explicitly disables DNS name resolution |
|------------------|------------------------------------------------------------------------------------------------------------|
| `conf` [`=`file] | reads DNS server addresses from the specified file, or from `/etc/resolv.conf` if no file is specified |
The file may contain `nameserver` lines in the same format used by the
system resolver:
```text
nameserver 127.0.1.4
nameserver 127.0.1.5
```
Addresses read from the file are added to any addresses specified explicitly
in the directive, and all of them are then queried together in a
round-robin fashion. If the file is absent, cannot be read, or lists no
addresses, and none are configured explicitly, Angie falls back to the
default server `127.0.0.1:53`.
At runtime, Angie re-reads the file when it changes, updating the set of DNS
servers.
By default, Angie caches each answer for the duration of the TTL value in the
DNS response. The optional `valid` parameter overrides this:
| `valid` | *optional* parameter allows overriding the response cache validity period |
|-----------|-----------------------------------------------------------------------------|
```nginx
resolver 127.0.0.53 [::1]:5353 valid=30s;
```
By default, Angie will look up both IPv4 and IPv6 addresses while resolving.
| `ipv4=off` | disables looking up of IPv4 addresses |
|--------------|-----------------------------------------|
| `ipv6=off` | disables looking up of IPv6 addresses |
| `status_zone` | *optional* parameter; enables the collection of DNS server request and response metrics in the specified zone, exposing them in [/status/resolvers/](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#api-status-resolvers), the [DNS Resolvers Tab](https://en.angie.software//angie/docs/configuration/monitoring.md#samp-dns-resolvers-tab), and [Prometheus](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#http-prometheus) output. Without it, these metrics are not collected and no warning is logged |
|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
### resolver_timeout
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `resolver_timeout` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| Default | `resolver_timeout 30s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, upstream |
Sets a timeout for name resolution, for example:
```nginx
resolver_timeout 5s;
```
### root
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `root` path; |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default | `root html;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, if in location |
Sets the root directory for requests. For example, with the following configuration
```nginx
location /i/ {
root /data/w3;
}
```
The `/data/w3/i/top.gif` file will be sent in response to the `/i/top.gif` request.
The path value can contain variables, except [$document_root](#v-document-root) and [$realpath_root](#v-realpath-root).
A path to the file is constructed by merely adding a URI to the value of the root directive. If a URI has to be modified, the [alias](#alias) directive should be used. A trailing slash in the path value is dropped, since the URI is appended with its own leading slash.
### satisfy
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `satisfy` `all` | `any`; |
|------------------------------------------------------------------------------------------|----------------------------|
| Default | `satisfy all;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Allows access if all (`all`) or at least one (`any`) of the [Access](https://en.angie.software//angie/docs/configuration/modules/http/http_access.md#http-access), [Auth Basic](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_basic.md#http-auth-basic), or [Auth Request](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#http-auth-request) modules allow access.
```nginx
location / {
satisfy any;
allow 192.168.1.0/32;
deny all;
auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
}
```
### send_lowat
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `send_lowat` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| Default | `send_lowat 0;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
If the directive is set to a non-zero value, Angie will try to minimize the number of send operations on client sockets by using either the `NOTE_LOWAT` flag of the [kqueue](https://en.angie.software//angie/docs/configuration/processing.md#kqueue) method or the `SO_SNDLOWAT` socket option. In both cases the specified size is used.
### send_timeout
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `send_timeout` [time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
| Default | `send_timeout 60s;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets a timeout for transmitting a response to the client. The timeout is set only between two successive write operations, not for the transmission of the whole response. If the client does not receive anything within this time, the connection is closed.
### sendfile
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `sendfile` `on` | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default | `sendfile off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, if in location |
Enables or disables the use of `sendfile()`.
[aio](#aio) can be used to pre-load data for `sendfile()`:
```nginx
location /video/ {
sendfile on;
tcp_nopush on;
aio on;
}
```
In this configuration, `sendfile()` is called with the `SF_NODISKIO` flag which causes it not to block on disk I/O, but, instead, report back that the data are not in memory. Angie then initiates an asynchronous data load by reading one byte. On the first read, the FreeBSD kernel loads the first 128K bytes of a file into memory, although next reads will only load data in 16K chunks. This can be changed using the [read_ahead](#read-ahead) directive.
### sendfile_max_chunk
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `sendfile_max_chunk` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| Default | `sendfile_max_chunk 2m;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Limits the amount of data that can be transferred in a single `sendfile()` call. Without the limit, one fast connection may seize the worker process entirely.
### server
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `server` { ... } |
|------------------------------------------------------------------------------------------|--------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Sets configuration for a virtual server. There is no clear separation between IP-based (based on the IP address) and name-based (based on the "Host" request header field) virtual servers. Instead, the [listen](#listen) directives describe all addresses and ports that should accept connections for the server, and the [server_name](#server-name) directive lists all server names.
Example configurations are provided in the [How Angie processes a request](https://en.angie.software//angie/docs/configuration/processing.md#request-processing) document.
### server_name
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `server_name` name ...; |
|------------------------------------------------------------------------------------------|---------------------------|
| Default | `server_name ""`; |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | server |
Sets names of a virtual server, for example:
```nginx
server {
server_name example.com www.example.com;
}
```
The first name becomes the primary server name.
Server names can include an asterisk ("\*") replacing the first or last part of a name:
```nginx
server {
server_name example.com *.example.com www.example.*;
}
```
Such names are called wildcard names.
The first two of the names mentioned above can be combined in one:
```nginx
server {
server_name .example.com;
}
```
It is also possible to use regular expressions in server names, preceding the name with a tilde ("~"):
```nginx
server {
server_name ~^www\d+\.example\.com$ www.example.com;
}
```
Regular expressions can contain captures that can later be used in other directives:
```nginx
server {
server_name ~^(www\.)?(.+)$;
location / {
root /sites/$2;
}
}
server {
server_name _;
location / {
root /sites/default;
}
}
```
Named captures in regular expressions create variables
that can later be used in other directives:
```nginx
server {
server_name ~^(www\.)?(?.+)$;
location / {
root /sites/$domain;
}
}
server {
server_name _;
location / {
root /sites/default;
}
}
```
#### NOTE
If the directive's parameter is set to [$hostname](#v-hostname),
the machine name is used.
An empty server name can also be specified:
```nginx
server {
server_name www.example.com "";
}
```
When searching for a virtual server by name,
if the name matches more than one of the specified variants
(for example, both a wildcard name and regular expression match),
the first matching variant will be chosen, in the following order of priority:
- exact name;
- longest wildcard name starting with an asterisk, e.g. `*.example.com`;
- longest wildcard name ending with an asterisk, e.g. `mail.*`;
- first matching regular expression (in order of appearance in the configuration file),
including an empty name.
#### WARNING
To use `server_name` with TLS,
TLS connection termination is required.
This directive matches against the `Host` in the HTTP request,
so the handshake must be completed and the connection decrypted.
### server_name_in_redirect
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `server_name_in_redirect` `on` | `off`; |
|------------------------------------------------------------------------------------------|-------------------------------------------|
| Default | `server_name_in_redirect off`; |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables the use of the primary server name, specified by the [server_name](#server-name) directive, in [absolute](#absolute-redirect) redirects issued by Angie.
| `on` | the primary server name set by the [server_name](#server-name) directive is used |
|--------|----------------------------------------------------------------------------------------------------------------------------|
| `off` | the name from the "Host" request header field is used. If this field is not present, the IP address of the server is used. |
The use of the port in redirects is controlled by the [port_in_redirect](#port-in-redirect) directive.
### server_names_hash_bucket_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `server_names_hash_bucket_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| Default | `server_names_hash_bucket_size 32` | `64` | `128;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Sets the bucket size for the server names hash tables. The default value depends on the size of the processor's cache line. The details of setting up hash tables are provided in a [separate document](https://en.angie.software//angie/docs/configuration/configfile.md#configure-hashes).
### server_names_hash_max_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `server_names_hash_max_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| Default | `server_names_hash_max_size 512`; |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Sets the maximum size of the server names hash tables. The details of setting up hash tables are provided in a [separate document](https://en.angie.software//angie/docs/configuration/configfile.md#configure-hashes).
### server_tokens
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `server_tokens` `on` | `off` | `build` | string; |
|------------------------------------------------------------------------------------------|----------------------------------------------------|
| Default | `server_tokens on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables emitting Angie version
on error pages and in the `Server` response header field.
The `build` parameter enables emitting the build name,
set by the respective [configure](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure) parameter,
along with the version.
In Angie PRO, if the directive sets a string, which may also contain variables,
the error pages and the `Server` response header field
will use the string's variable-interpolated value
instead of server name, version, and build name.
An empty string disables emitting the `Server` field.
### status_zone
#### Versionchanged
Changed in version 1.12.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `status_zone` `off` | zone | key `zone=`zone[:number]; |
|------------------------------------------------------------------------------------------|----------------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | server, location, if in location |
Allocates a shared memory zone for collecting
[/status/http/location_zones/](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#api-status-http-location-zones) and [/status/http/server_zones/](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#api-status-http-server-zones) metrics.
Several `server` contexts
can share the same zone for data collection;
the special value `off`
disables data collection in nested `location` blocks.
The syntax with a single zone value
combines all metrics for the current context into one shared memory zone:
```nginx
server {
listen 80;
server_name *.example.com;
status_zone single;
# ...
}
```
The alternative syntax allows setting the following parameters:
| key | A string with variables, whose value determines the grouping of requests in the zone. All requests producing identical values after substitution are grouped together. If substitution yields an empty value, metrics aren't updated. |
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| zone | The name of the shared memory zone. |
| number (optional) | The maximum number of separate groups for collecting metrics. If new key values would exceed this limit, they are grouped under `zone` instead.
The default value is 1. |
In the following example,
all requests sharing the same `$host` value
are grouped into the `host_zone`.
Metrics are tracked separately for each unique `$host`
until there are 10 metric groups.
Once this limit is reached,
any additional `$host` values are included under the `host_zone`:
```nginx
server {
listen 80;
server_name *.example.com;
status_zone $host zone=host_zone:10;
location / {
proxy_pass http://example.com;
}
}
```
The resulting metrics are thus split between individual hosts in the API output.
#### NOTE
These metrics are collected only when `status_zone` is set. Without it,
the server or location does not appear in [/status/http/server_zones/](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#api-status-http-server-zones),
[/status/http/location_zones/](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#api-status-http-location-zones), the [HTTP Zones Widget](https://en.angie.software//angie/docs/configuration/monitoring.md#http-zones-widget), or
[Prometheus](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#http-prometheus) output, and no warning is logged.
See [Example configuration](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#example-configuration).
### subrequest_output_buffer_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `subrequest_output_buffer_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| Default | `subrequest_output_buffer_size 4k` | `8k;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the size of the buffer used for storing the response body of a subrequest.
By default, the buffer size is equal to one memory page. This is either
`4K` or `8K`, depending on a platform. It can be made smaller,
however.
#### NOTE
The directive is applicable only for subrequests with response bodies saved into memory. For example, such subrequests are created by [SSI](https://en.angie.software//angie/docs/configuration/modules/http/http_ssi.md#ssi-include-set).
### tcp_nodelay
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `tcp_nodelay` `on` | `off`; |
|------------------------------------------------------------------------------------------|-------------------------------|
| Default | `tcp_nodelay on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables the use of the `TCP_NODELAY` option. The option is enabled when a connection is transitioned into the keep-alive state. Additionally, it is enabled on SSL connections, for unbuffered proxying, and for [WebSocket proxying](https://en.angie.software//angie/docs/configuration/processing.md#websocket-proxy).
### tcp_nopush
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `tcp_nopush` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------|
| Default | `tcp_nopush off`; |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables the use of the `TCP_NOPUSH` socket option on FreeBSD or the `TCP_CORK` socket option on Linux. The options are enabled only when [sendfile](#sendfile) is used. Enabling the option allows
* sending the response header and the beginning of a file in one packet, on Linux and FreeBSD 4.\*;
* sending a file in full packets.
### time_format
#### Versionadded
Added in version 1.12.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `time_format` $variable format; |
|------------------------------------------------------------------------------------------|-----------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Defines a $variable to hold the current local time, rendered with a custom
format string of `strftime`-like specifiers plus `%L` for
milliseconds. The directive is useful where [$time_local](#v-time-local)
and [$time_iso8601](#v-time-iso8601) fall short, for example because they
provide no sub-second precision:
```nginx
time_format $time_ms "%Y-%m-%dT%H:%M:%S.%L%Z";
log_format tf '$time_ms $remote_addr "$request" $status';
```
With the format above, `$time_ms` expands to a value such as
`2024-01-15T14:34:56.789+03:00`.
Redefining a built-in variable, such as [$time_local](#v-time-local), or
repeating `time_format` for the same name fails the configuration load
with an error like: "the duplicate "..." variable".
The format string accepts the following specifiers, evaluated in the same
local time zone as [$time_local](#v-time-local):
| `%Y` | 4-digit year |
|------------|--------------------------------------------|
| `%y` | 2-digit year |
| `%m` | month, `01-12` |
| `%d` | day of month, `01-31` |
| `%e` | day of month, space-padded, `1-31` |
| `%H` | hour, `00-23` |
| `%I` | hour, `01-12` |
| `%M` | minute, `00-59` |
| `%S` | second, `00-59` |
| `%L` | milliseconds, `000-999` |
| `%p` | uppercase `AM` / `PM` |
| `%P` | lowercase `am` / `pm` |
| `%a` | abbreviated weekday name, `Sun-Sat` |
| `%A` | full weekday name, `Sunday-Saturday` |
| `%b`, `%h` | abbreviated month name, `Jan-Dec` |
| `%B` | full month name, `January-December` |
| `%z` | time zone offset, `+0300` |
| `%Z` | time zone offset, ISO 8601 style, `+03:00` |
| `%n` | newline |
| `%t` | tab |
| `%%` | literal `%` |
#### NOTE
An unrecognized specifier is copied to the output verbatim, including the
leading `%`; a standalone `%` at the very end of the format
string is dropped.
### try_files
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `try_files` file ... uri;
`try_files` file ... =code; |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | server, location |
Checks the existence of files in the specified order and uses the first found file for request processing; the processing is performed in the current [location](#location)'s context. The path to a file is constructed from the file parameter according to the [root](#root) and [alias](#alias) directives. It is possible to check directory's existence by specifying a slash at the end of a name, e.g. `$uri/`. If none of the files were found, an internal redirect to the uri specified in the last parameter is made.
The file and uri parameters can contain variables.
For example:
```nginx
location /images/ {
try_files $uri /images/default.gif;
}
location = /images/default.gif {
expires 30s;
}
```
The last parameter can be a URI for an internal redirect,
a reference to a named `location` (e.g., `@drupal`),
or a response code in the form `=code` (e.g., `=404`):
```nginx
location / {
try_files $uri $uri/index.html $uri.html =404;
}
```
It should be noted that excessive use of the `try_files` directive
increases the number of system calls,
which can negatively impact performance.
Thus, `try_files` should not be used to replicate behavior
that is effectively the default behavior, for example:
```nginx
location /bad_pattern {
# try_files $uri $uri/ =404; # not recommended!
}
```
Also, `try_files` should not be used
solely for redirecting when a file is absent.
The reason is that the `try_files` directive has two peculiarities:
- First, it checks the existence of each file,
which increases system load.
- Second, any file opening errors (e.g., `too many open files`,
permission errors) are also treated as file absence and trigger a fallback
to the backup handler, which can mask 5xx errors with successful responses
and lead to incorrect caching.
Thus, in practice, the following problematic construction can be encountered:
```nginx
location / {
try_files $uri $uri/ @drupal; # not recommended!
}
```
The problem here is that the only purpose is redirection.
Using `try_files` leads to the disadvantages listed above,
but provides no benefits,
since checking for file existence is not needed.
The correct solution is to use the [error_page](#error-page) directive,
which does not have these disadvantages:
```nginx
error_page 404 = @drupal;
log_not_found off;
```
In contrast, in the following example:
```nginx
location ~ \.php$ {
try_files $uri @drupal;
fastcgi_pass ...;
fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
# ...
}
```
The `try_files` directive checks for the existence of the PHP file
before passing the request to the FastCGI server configured in the same block;
here the use of `try_files` is justified.
### Example of use when proxying to Mongrel:
```nginx
location / {
try_files /system/maintenance.html
$uri $uri/index.html $uri.html
@mongrel;
}
location @mongrel {
proxy_pass http://mongrel;
}
```
### Example of use with Drupal/FastCGI:
```nginx
location / {
error_page 404 = @drupal;
}
location ~ \.php$ {
try_files $uri @drupal;
fastcgi_pass ...;
fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param QUERY_STRING $args;
# ... other fastcgi_param
}
location @drupal {
fastcgi_pass ...;
fastcgi_param SCRIPT_FILENAME /path/to/index.php;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param QUERY_STRING q=$uri&$args;
# ... other fastcgi_param
}
```
### Example of use with Wordpress and Joomla:
```nginx
location / {
error_page 404 = @wordpress;
}
location ~ \.php$ {
try_files $uri @wordpress;
fastcgi_pass ...;
fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
# ... other fastcgi_param
}
location @wordpress {
fastcgi_pass ...;
fastcgi_param SCRIPT_FILENAME /path/to/index.php;
# ... other fastcgi_param
}
```
### types
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `types` { ... } |
|------------------------------------------------------------------------------------------|------------------------------------------------------------|
| Default | `types *text/html html; image/gif gif; image/jpeg jpg;* ` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Maps file name extensions to MIME types of responses. Extensions are case-insensitive. Several extensions can be mapped to one type, for example:
```nginx
types {
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
}
```
A sufficiently complete mapping table is distributed with Angie and is located in the `conf/mime.types` file.
To make a particular `location` return the "application/octet-stream" MIME type for all responses, the following configuration can be used:
```nginx
location /download/ {
types { }
default_type application/octet-stream;
}
```
### types_hash_bucket_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `types_hash_bucket_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| Default | `types_hash_bucket_size 64;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the bucket size for the types hash tables. The details of setting up hash tables are discussed [separately](https://en.angie.software//angie/docs/configuration/configfile.md#configure-hashes).
### types_hash_max_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `types_hash_max_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
| Default | `types_hash_max_size 1024;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the maximum size of the types hash tables. The details of setting up hash tables are discussed [separately](https://en.angie.software//angie/docs/configuration/configfile.md#configure-hashes).
### underscores_in_headers
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `underscores_in_headers` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------------|
| Default | `underscores_in_headers off`; |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server |
Enables or disables the use of underscores in client request header fields. When the use of underscores is disabled, request header fields whose names contain underscores are marked as invalid and are subject to the [ignore_invalid_headers](#ignore-invalid-headers) directive.
If the directive is specified at the [server](#server) level, the value from the default server can be used.
### variables_hash_bucket_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `variables_hash_bucket_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| Default | `variables_hash_bucket_size 64;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Sets the bucket size for the variables hash table. The details of setting up hash tables are discussed [separately](https://en.angie.software//angie/docs/configuration/configfile.md#configure-hashes).
### variables_hash_max_size
#### Versionchanged
Changed in version 1.11.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `variables_hash_max_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| Default | `variables_hash_max_size 2048;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Sets the maximum size of the variables hash table. The details of setting up hash tables are discussed [separately](https://en.angie.software//angie/docs/configuration/configfile.md#configure-hashes).
## Built-in Variables
The `http_core` module supports built-in variables with names matching the
Apache Server variables. First of all, these are variables representing client
request header fields, such as `$http_user_agent`, `$http_cookie`,
and so on. Also, there are other variables:
### `$angie_version`
Angie version
### `$arg_`
argument name in the request line
### `$args`
arguments in the request line
### `$binary_remote_addr`
client address in a binary form, value's length is always 4 bytes for IPv4 addresses or 16 bytes for IPv6 addresses
### `$body_bytes_sent`
number of bytes sent to the client, not counting the response header; this variable is compatible with the "%B" parameter of the `mod_log_config` Apache module
### `$bytes_sent`
number of bytes sent to a client
### `$connection`
connection serial number
### `$connection_requests`
current number of requests made through a connection
### `$connection_time`
connection time in seconds with a milliseconds resolution
### `$content_length`
`Content-Length` request header field
### `$content_type`
`Content-Type` request header field
### `$cookie_`
cookie with the specified name
### `$document_root`
[root](#root) or [alias](#alias) directive's value for the current request
### `$document_uri`
same as [$uri](#v-uri)
### `$host`
in this order of precedence: host name from the request line, or host name from the "Host" request header field, or the server name matching a request
### `$hostname`
host name
### `$http_`
#### Versionchanged
Changed in version 1.11.0: In HTTP/3 requests, `$http_host` is initialized from the
`:authority` pseudo-header if the `Host` header was not
passed by the client.
arbitrary request header field; the last part of the variable name corresponds to the field name converted to lower case with dashes replaced by underscores
### `$https`
`on` if connection operates in SSL mode, or an empty string otherwise
### `$is_args`
`?` if a request line has arguments, or an empty string otherwise
### `$is_request_port`
`:` if the [$request_port](#v-request-port) value is non-empty, or an empty string otherwise
### `$limit_rate`
setting this variable enables response rate limiting; see [limit_rate](#limit-rate)
### `$msec`
current time in seconds with the milliseconds resolution
### `$nginx_version`
nginx version
### `$pid`
PID of the worker process
### `$pipe`
`p` if request was pipelined, `.` otherwise
### `$proxy_protocol_addr`
client address from the PROXY protocol header
The PROXY protocol must be previously enabled by setting the `proxy_protocol` parameter in the [listen](#listen) directive.
### `$proxy_protocol_port`
client port from the PROXY protocol header
The PROXY protocol must be previously enabled by setting the `proxy_protocol` parameter in the [listen](#listen) directive.
### `$proxy_protocol_server_addr`
server address from the PROXY protocol header
The PROXY protocol must be previously enabled by setting the `proxy_protocol` parameter in the [listen](#listen) directive.
### `$proxy_protocol_server_port`
server port from the PROXY protocol header
The PROXY protocol must be previously enabled by setting the `proxy_protocol` parameter in the [listen](#listen) directive.
### `$proxy_protocol_tlv_`
TLV from the PROXY protocol header. The name can be a TLV type name or its numeric value. In the latter case, the value is hexadecimal and should be prefixed with `0x`:
```none
$proxy_protocol_tlv_alpn
$proxy_protocol_tlv_0x01
```
SSL TLVs can also be accessed by TLV type name or its numeric value, both prefixed by `ssl_`:
```none
$proxy_protocol_tlv_ssl_version
$proxy_protocol_tlv_ssl_0x21
```
The following TLV type names are supported:
* `alpn (0x01)` - upper layer protocol used over the connection
* `authority (0x02)` - host name value passed by the client
* `unique_id (0x05)` - unique connection id
* `netns (0x30)` - name of the namespace
* `ssl (0x20)` - binary SSL TLV structure
The following SSL TLV type names are supported:
* `ssl_version (0x21)` - SSL version used in client connection
* `ssl_cn (0x22)` - SSL certificate Common Name
* `ssl_cipher (0x23)` - name of the used cipher
* `ssl_sig_alg (0x24)` - algorithm used to sign the certificate
* `ssl_key_alg (0x25)` - public-key algorithm
Also, the following special SSL TLV type name is supported:
* `ssl_verify` - client SSL certificate verification result: `0` if the client presented a certificate and it was successfully verified, non-zero otherwise
The PROXY protocol must be previously enabled by setting the `proxy_protocol` parameter in the [listen](#listen) directive.
### `$query_string`
same as [$args](#v-args)
### `$realpath_root`
an absolute pathname corresponding to the [root](#root) or [alias](#alias) directive's value for the current request, with all symbolic links resolved to real paths
### `$remote_addr`
client address
### `$remote_port`
client port
### `$remote_user`
user name supplied with the Basic authentication
### `$request`
full original request line
### `$request_body`
request body
The variable's value is *made available* in locations processed by the [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass), [fastcgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-pass), [uwsgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#uwsgi-pass), and [scgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#scgi-pass) directives when the request body was read to a [memory buffer](#client-body-buffer-size).
### `$request_body_file`
name of a temporary file with the request body
At the end of processing, the file needs to be removed. To always write the request body to a file, enable [client_body_in_file_only](#client-body-in-file-only). When passing the name of a temporary file in a proxied request or in a request to a FastCGI/uwsgi/SCGI server, the passing of the request body itself should be disabled with the [proxy_pass_request_body off](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass-request-body), [fastcgi_pass_request_body off](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-pass-request-body), [uwsgi_pass_request_body off](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#uwsgi-pass-request-body), or [scgi_pass_request_body off](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#scgi-pass-request-body) directives, respectively.
### `$request_completion`
`OK` if a request has completed, or an empty string otherwise
### `$request_filename`
file path for the current request, based on the [root](#root) or [alias](#alias) directives, and the request URI
### `$request_id`
unique request identifier generated from 16 random bytes, in hexadecimal
### `$request_length`
request length in bytes (including request line, header, and request body)
### `$request_method`
request method, usually `GET` or `POST`
### `$request_port`
in this order of precedence: port number from the authority component of the request URI, or port number from the "Host" request header field
### `$request_time`
request processing time in seconds with a milliseconds resolution; time elapsed since the first bytes were read from the client
### `$request_uri`
full original request URI (with arguments), never modified during request processing; see [$uri](#v-uri) for the current (potentially rewritten) URI
### `$scheme`
request scheme, "http" or "https"
### `$sent_body`
#### Versionadded
Added in version 1.11.0.
response body of a subrequest or external request when it is stored in memory;
otherwise an empty string
### `$sent_http_`
arbitrary response header field; the last part of the variable name corresponds to the field name converted to lower case with dashes replaced by underscores
### `$sent_trailer_`
arbitrary field sent at the end of the response; the last part of the variable name corresponds to the field name converted to lower case with dashes replaced by underscores
### `$server_addr`
address of the server which accepted a request
Computing a value of this variable usually requires one system call. To avoid a system call, the [listen](#listen) directives must specify addresses and use the `bind` parameter.
### `$server_name`
name of the server which accepted a request
### `$server_port`
port of the server which accepted a request
### `$server_protocol`
request protocol, usually "HTTP/1.0", "HTTP/1.1", or "HTTP/2.0"
### `$status`
response status
### `$tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd, $tcpinfo_rcv_space`
information about the client TCP connection; available on systems that support the `TCP_INFO` socket option; on Linux, `$tcpinfo_rtt` and `$tcpinfo_rttvar` are in microseconds, `$tcpinfo_snd_cwnd` is a number of segments, and `$tcpinfo_rcv_space` is in bytes
### `$time_iso8601`
local time in the ISO 8601 standard format
### `$time_local`
local time in the Common Log Format
### `$uri`
current URI in request, [normalized](#location)
The value of `$uri` may change during request processing, e.g. when rewriting with [rewrite](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#id5), when doing internal redirects, or when using index files. See [Choosing locations](https://en.angie.software//angie/docs/configuration/processing.md#pick-location) for how the value is mapped to a filesystem path.
# https://en.angie.software/angie/docs/configuration/modules/http/http_access.md
# Access
The module controls access to server resources based on client IP addresses or
networks. It allows permitting or blocking access for specific IP addresses,
IP ranges, or UNIX domain sockets to enhance security by restricting access to
sensitive areas of a website or application.
Access can also be restricted by using a password with the [Auth Basic](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_basic.md#http-auth-basic) module or based on the result of a subrequest with the
[Auth Request](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#http-auth-request) module. To apply both address and
password restrictions at the same time, use the [satisfy](https://en.angie.software//angie/docs/configuration/modules/http/index.md#satisfy) directive.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module is built by
default; it can be disabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--without-http_access_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
## Configuration Example
```nginx
location / {
deny 192.168.1.1;
allow 192.168.1.0/24;
allow 10.1.1.0/16;
allow 2001:0db8::/32;
deny all;
}
```
Rules are evaluated sequentially until a match is found. In this example, access
is allowed only for the IPv4 networks `10.1.1.0/16` and
`192.168.1.0/24`, excluding the specific address `192.168.1.1`, and
for the IPv6 network `2001:0db8::/32`. When there are many rules, it is
preferable to use variables from the [Geo](https://en.angie.software//angie/docs/configuration/modules/http/http_geo.md#http-geo) module.
## Directives
### allow
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `allow` address | CIDR | `unix:` | `all`; |
|------------------------------------------------------------------------------------------|---------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, limit_except |
Allows access for a specified network or address.
The special value `all` means all client IP addresses.
The special value `unix:` allows access for any UNIX domain sockets.
### deny
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `deny` address | CIDR | `unix:` | `all`; |
|------------------------------------------------------------------------------------------|--------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, limit_except |
Denies access for a specified network or address.
The special value `all` means all client IP addresses.
The special value `unix:` denies access for any UNIX domain sockets.
# https://en.angie.software/angie/docs/configuration/modules/http/http_acme.md
# ACME
Provides automatic certificate retrieval using the [ACME protocol](https://datatracker.ietf.org/doc/html/rfc8555).
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module isn't built
by default; it must be enabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--with-http_acme_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
## Configuration Example
In this example, an ACME client named `example` automatically obtains
and renews a certificate for `example.com` and `www.example.com`
using the default HTTP validation:
```nginx
http {
resolver 127.0.0.53; # Required for the 'acme_client' directive
acme_client example https://acme-v02.api.letsencrypt.org/directory;
server {
listen 80; # Optional if no server listens on the HTTP challenge port
# (see 'acme_http_port' directive)
listen 443 ssl;
server_name example.com www.example.com;
acme example;
ssl_certificate $acme_cert_example;
ssl_certificate_key $acme_cert_key_example;
}
}
```
For other validation methods (DNS, ALPN, hook-based) and detailed setup
instructions, see the [ACME Configuration](https://en.angie.software//angie/docs/configuration/acme.md#acme-config) section.
## Directives
### acme
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `acme` name; |
|------------------------------------------------------------------------------------------|----------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | server |
Specifies the [ACME client](#acme-client) that obtains a certificate
for the valid certificate identifiers in this [server](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server) block.
A single certificate covers all valid domain names and IP addresses specified
in the [server_name](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server-name) directives of every [server](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server) block
that references the client with the given name;
if the `server_name` configuration changes,
the certificate is renewed to reflect the changes.
Each time Angie starts or reloads its configuration, new certificates are
requested for all identifiers that are missing a valid certificate.
Possible reasons include certificate expiration,
missing or unreadable files,
a change in certificate settings,
or a previous request that ended in an error.
#### NOTE
This directive only controls which valid certificate identifiers
are included in certificate requests;
it does not affect where the certificate can be used.
Any `server` block can reference the certificate
through the [$acme_cert_](#v-acme-cert-name) variable,
regardless of whether the block contains an `acme` directive.
Removing `acme` from a `server` block
simply excludes that block's [server_name](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server-name) values
from future certificate requests,
but does not prevent the block from using the certificate.
#### NOTE
Currently, domains specified with regular expressions
are not supported and will be skipped.
Wildcard domains are supported only with `challenge=dns`
in `acme_client`.
IPv4 and IPv6 addresses are supported unless the client uses
`challenge=dns`. With DNS validation enabled, IP addresses are skipped.
This directive can be specified multiple times
to load certificates of different types, for example RSA and ECDSA:
```nginx
server {
listen 443 ssl;
server_name example.com www.example.com;
ssl_certificate $acme_cert_rsa;
ssl_certificate_key $acme_cert_key_rsa;
ssl_certificate $acme_cert_ecdsa;
ssl_certificate_key $acme_cert_key_ecdsa;
acme rsa;
acme ecdsa;
}
```
### acme_client
#### Versionchanged
Changed in version 1.11.0.
#### Versionchanged
Changed in version 1.12.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `acme_client` name uri [`enabled=``on` | `off`] [`key_type=`type] [`key_bits=`number] [`email=`email] [`max_cert_size=`size] [`max_key_auth_size=`size] [`renew_before_expiry=`time] [`renew_on_load`] [`retry_after_error=`off|time] [`challenge=``dns` | `http` | `alpn`] [`profile=`name] [`account_key=`file] [`eab=`id[:alg]:key]; |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Defines an ACME client with a globally unique name.
It must be valid for a directory,
is a [string with variables](https://en.angie.software//angie/docs/configuration/configfile.md#string-variables),
and will be used case-insensitively.
Each client manages a single certificate; to obtain separate certificates,
configure multiple `acme_client` blocks (see
[Separate Certificates for Different Domains](https://en.angie.software//angie/docs/configuration/acme.md#acme-config-multiple-clients)).
The second mandatory parameter is the uri of the ACME directory.
For example, the Let's Encrypt ACME directory URI is [specified](https://letsencrypt.org/getting-started/)
as
[https://acme-v02.api.letsencrypt.org/directory](https://acme-v02.api.letsencrypt.org/directory).
#### NOTE
The ACME module adds a named `location @acme`
to the [client](https://en.angie.software//angie/docs/configuration/modules/http/index.md#client) context,
which can be used to configure requests to the ACME directory;
by default, this `location`
contains a [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass) directive with the directory uri,
to which other settings from the [Proxy](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#http-proxy) module can be added.
For this directive to work,
a [resolver](https://en.angie.software//angie/docs/configuration/modules/http/index.md#resolver) must be configured in the same context.
#### NOTE
For testing purposes,
certificate authorities usually provide separate staging environments.
For example, the [Let's Encrypt staging environment](https://letsencrypt.org/docs/staging-environment/)
is
[https://acme-staging-v02.api.letsencrypt.org/directory](https://acme-staging-v02.api.letsencrypt.org/directory).
| `enabled` | Enables or disables certificate renewal for the client; this is useful, for example, for temporarily suspending without removing the client from the configuration.
Default: `on`. |
|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `key_type` | The type of private key algorithm for the certificate. Valid values: `rsa`, `ecdsa`.
Default: `ecdsa`. |
| `key_bits` | Number of bits in the certificate key. Default: 256 for `ecdsa`, 2048 for `rsa`. |
| `email` | Optional email address for feedback; used when creating an account on the CA server. |
| `max_cert_size` | Specifies the maximum allowed size of a new certificate file to reserve space for the new certificate in shared memory; the more domains the certificate is requested for, the more space is required. The size is specified in bytes; the `k` and `m` suffixes are also accepted. This parameter does not limit the size of ACME server responses; use [acme_max_response_size](#acme-max-response-size) for that.
If the parameter is not set, Angie calculates an approximate size based on the configured domain list and uses it for shared memory allocation.
If a certificate already exists at startup but its size exceeds the `max_cert_size` value, the `max_cert_size` value is dynamically increased to match the size of the existing certificate file.
If the size of a certificate obtained during renewal exceeds `max_cert_size`, the renewal process will fail with an error.
Default: calculated automatically. |
| `max_key_auth_size` | Limits the size of the key authorization string that Angie stores in shared memory for an ACME challenge. If the ACME server returns a key authorization string larger than this value, the request fails with an error that advises raising `max_key_auth_size`.
Although specified on the `acme_client` line, this is a single setting shared by all clients in the `http` block.
Default: `2k`. |
| `renew_before_expiry` | [Time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units) before certificate expiration when renewal should begin.
Default: `30d`. |
| `renew_on_load` | Specifies that the certificate should be forcibly renewed each time the configuration is loaded. |
| `retry_after_error` | [Time](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units) to wait before retrying if certificate retrieval failed. If set to `off`, the client will not retry to obtain the certificate after an error.
Default: `2h`.
This delay applies while Angie is running; a configuration reload re-requests the certificate immediately. |
| `challenge` | Specifies the verification type for the ACME client. Valid values: `dns`, `http`, `alpn`.
The `alpn` value enables [TLS-ALPN-01](https://datatracker.ietf.org/doc/rfc8737/) validation and requires Angie to be built with OpenSSL that supports ALPN (not supported with BoringSSL or AWS-LC builds).
Default: `http`. |
| `profile` | Requests a specific ACME profile from the certificate authority. A profile is a CA-defined variant of the certificate and validation settings, for example the certificate lifetime or which identifier types may be requested.
For instance, Let's Encrypt describes its available profiles in the [profiles documentation](https://letsencrypt.org/docs/profiles/).
The ACME server must advertise this profile in its directory metadata; otherwise the client cannot obtain a certificate. |
| `account_key` | Specifies the full path to a file containing a key in PEM format. This is useful if you want to use an existing account key instead of automatic generation, or if you need to use one key for multiple ACME clients.
Supported key types:
- RSA keys with lengths that are multiples of 8, ranging from 2048 to 8192 bits. - ECDSA keys with lengths of 256, 384, or 521 bits.
When specifying the `account_key` parameter, ensure that the key file actually exists. If the file is missing, Angie will attempt to create it at the specified path.
Note that keys for ACME clients are created in the order the corresponding clients are mentioned in the configuration in [acme_client](#acme-client), [acme](#id1), or [acme_hook](#acme-hook) directives. Therefore, if one client should use a key created for another, that other client must appear earlier in the configuration.
Additionally, keys are only created for clients that have the `enabled=on` parameter set. |
| `eab` | Configures [External Account Binding](https://datatracker.ietf.org/doc/html/rfc8555#section-7.3.4) (EAB), binding the ACME account to an account already registered with the certificate authority (CA).
The value has the form `eab=`id[:alg]:key:
- id — the key identifier issued by the CA. - alg — the HMAC signing algorithm used to compute the binding signature: `HS256` (default), `HS384`, or `HS512`. - key — the Base64URL-encoded MAC key associated with id on the CA side.
If the CA requires external account binding but the parameter is not set, the client reports an error without creating an ACME account. The EAB credentials are only sent when a new ACME account is registered; an existing ACME account is reused as is. |
### acme_client_path
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `acme_client_path` path; |
|------------------------------------------------------------------------------------------|----------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Overrides the path to the directory for storing certificates and keys,
set during build using the [build parameter](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--http-acme-client-path`.
### acme_dns_port
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `acme_dns_port` port | ip[:port] | [ip6][:port]; |
|------------------------------------------------------------------------------------------|----------------------------------------------------|
| Default | `acme_dns_port 53;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Specifies the port
that the module uses to handle DNS queries from the ACME server over UDP.
The port number must be in the range from 1 to 65535.
Specifying an IP address along with an optional port is also supported.
Both IPv4 addresses in the form `ip:port`
and IPv6 addresses in the form `[ip6]:port` can be used:
```nginx
acme_dns_port 8053;
acme_dns_port 127.0.0.1;
acme_dns_port [::1];
```
To use port number 1024 or lower,
Angie's master process must run with superuser privileges.
### acme_dns_ttl
#### Versionadded
Added in version 1.12.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `acme_dns_ttl` number; |
|------------------------------------------------------------------------------------------|--------------------------|
| Default | `acme_dns_ttl 1;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Sets the TTL, in seconds, of the TXT records the module returns in responses
to ACME servers' [DNS validation](https://en.angie.software//angie/docs/configuration/acme.md#acme-config-dns) queries. Accepts
values from 0 through 2147483647, as per [RFC 2181](https://datatracker.ietf.org/doc/html/rfc2181#section-8).
### acme_hook
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `acme_hook` name [uri]; |
|------------------------------------------------------------------------------------------|---------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | location |
Enables hook-based domain validation
for the [ACME client](#acme-client) specified by name.
When certificate issuance or renewal requires domain verification,
Angie generates an internal request
to the named `location` where this directive is placed.
How the request is handled depends entirely
on the other directives configured in the same `location`,
such as [fastcgi_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-pass), [proxy_pass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-pass),
or any other request handler.
| name | The name of the [ACME client](#acme-client) for which this hook handles domain verification. |
|--------|----------------------------------------------------------------------------------------------------|
| uri | A string with variables; specifies the request URI for hook calls.
Default: `/`. |
For example, the following configuration passes the values of [hook variables](#http-acme-variables)
to a FastCGI application through the request URI:
```nginx
acme_hook example uri=/acme_hook/$acme_hook_name?domain=$acme_hook_domain&key=$acme_hook_keyauth;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_pass ...;
```
### acme_http_port
#### Versionadded
Added in version 1.11.0.
#### Versionchanged
Changed in version 1.11.1.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `acme_http_port` port | ip[:port] | [ip6][:port]; |
|------------------------------------------------------------------------------------------|-----------------------------------------------------|
| Default | `acme_http_port 80;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Specifies the port
that the module uses to handle HTTP ACME challenge requests.
The port number must be in the range from 1 to 65535.
Specifying an IP address along with an optional port is also supported.
Both IPv4 addresses in the form `ip:port`
and IPv6 addresses in the form `[ip6]:port` can be used:
```nginx
acme_http_port 8080;
acme_http_port 127.0.0.1;
acme_http_port [::1];
```
If no server is configured to listen on the specified address and port,
the module creates a dedicated listener for HTTP challenges.
To use port number 1024 or lower,
Angie's master process must run with superuser privileges.
### acme_max_response_size
#### Versionadded
Added in version 1.11.0.
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `acme_max_response_size` [size](https://en.angie.software//angie/docs/configuration/configfile.md#measurement-units); |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| Default | `acme_max_response_size 32k;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Limits the maximum size of an ACME server response body. If a response exceeds
this limit, the request fails with an error. Increase the value if you see
errors like `too big subrequest response while sending to client`.
## Built-in Variables
### `$acme_cert_`
Contents of the last certificate file (if any)
obtained by the client with this name.
### `$acme_cert_key_`
Contents of the certificate key file
used by the client with this name.
#### NOTE
The certificate file is available
only if the ACME client has obtained at least one certificate,
but the key file is available immediately after startup.
### `$acme_hook_challenge`
The challenge type. Possible values: `dns`, `http`, `alpn`.
### `$acme_hook_client`
The name of the ACME client initiating the request.
### `$acme_hook_domain`
The domain being verified.
If it is a wildcard domain, it will be passed without the `*.` prefix.
### `$acme_hook_keyauth`
The authorization string:
- For DNS challenge, it is used as the value of the TXT record,
whose name is formed as
`_acme-challenge. + $acme_hook_domain + .`.
- For HTTP challenge, this string must be used
as the content of the response requested by the ACME server.
### `$acme_hook_name`
The hook name. For different challenge types, it may have different values and meanings:
| Value | Meaning for DNS challenge | Meaning for HTTP challenge |
|--------------------------|----------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| `add` (adding hook) | The corresponding TXT record must be added to the DNS configuration. | A response to the corresponding HTTP request must be prepared. |
| `remove` (removing hook) | The TXT record can be removed from the DNS configuration. | This HTTP request is no longer relevant; the previously created file with the authorization string can be removed. |
### `$acme_hook_token`
The verification token.
For HTTP challenge, it is used as the name of the requested file:
`/.well-known/acme-challenge/` + `$acme_hook_token`.
# https://en.angie.software/angie/docs/configuration/modules/http/http_addition.md
# Addition
The module is a filter that adds text before and after a response.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module isn't built
by default; it must be enabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--with-http_addition_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
## Configuration Example
```nginx
location / {
add_before_body /before_action;
add_after_body /after_action;
}
```
## Directives
### add_after_body
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `add_after_body` uri; |
|------------------------------------------------------------------------------------------|-------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Adds the text returned as a result of processing a given subrequest after the response body. An empty string (`""`) as a parameter cancels addition inherited from the previous configuration level.
### add_before_body
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `add_before_body` uri; |
|------------------------------------------------------------------------------------------|--------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Adds the text returned as a result of processing a given subrequest before the response body. An empty string (`""`) as a parameter cancels addition inherited from the previous configuration level.
### addition_types
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `addition_types` mime-type ...; |
|------------------------------------------------------------------------------------------|-----------------------------------|
| Default | `addition_types text/html;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Allows adding text in responses with the specified MIME types, in addition to "text/html". The special value "\*" matches any MIME type.
# https://en.angie.software/angie/docs/configuration/modules/http/http_api.md
# API
The `API` module implements an HTTP RESTful interface for obtaining basic information
about the web server in JSON format, as well as [statistics](#metrics) on client
connections, shared memory zones, DNS queries, HTTP requests, HTTP response cache,
[Stream](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#stream-core) module sessions, and zones of the
HTTP [Limit Conn](https://en.angie.software//angie/docs/configuration/modules/http/http_limit_conn.md#http-limit-conn), Stream [Limit Conn](https://en.angie.software//angie/docs/configuration/modules/stream/stream_limit_conn.md#stream-limit-conn), [Limit Req](https://en.angie.software//angie/docs/configuration/modules/http/http_limit_req.md#http-limit-req), and
HTTP [Upstream](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#http-upstream) modules, as well as information
about certificates specified in the configuration and obtained by
ACME clients.
#### NOTE
Explore a live example of the API output at
[https://console.angie.software/api/](https://console.angie.software/api/).
The interface accepts `GET` and `HEAD` HTTP methods;
a request with another method will cause an error:
```json
{
"error": "MethodNotAllowed",
"description": "The POST method is not allowed for the requested API element \"/\"."
}
```
In Angie PRO, this interface includes a [dynamic configuration](#api-config) section that allows changing settings without reloading the configuration or
restarting; currently, configuration of individual servers within
[upstream](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-upstream) is available.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module is built by
default; it can be disabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--without-http_api_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
## Directives
### api
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `api` path; |
|------------------------------------------------------------------------------------------|---------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | location |
Enables the HTTP RESTful interface in `location`.
The path parameter is mandatory. Similar to the [alias](https://en.angie.software//angie/docs/configuration/modules/http/index.md#alias) directive, it sets the path for replacing the one specified in `location`, but over the API tree rather than the filesystem.
If specified in a prefix `location`:
```nginx
location /stats/ {
api /status/http/server_zones/;
}
```
the part of the request URI matching the prefix /stats/ will be replaced with the path specified in the path parameter: /status/http/server_zones/. For example, a request to /stats/foo/ will access the API element `/status/http/server_zones/foo/`.
[Variables](https://en.angie.software//angie/docs/configuration/configfile.md#string-variables) are allowed: api /status/$module/server_zones/$name/ and usage inside regex location:
```nginx
location ~^/api/([^/]+)/(.*)$ {
api /status/http/$1_zones/$2;
}
```
Here the path parameter defines the full path to the API element;
thus, from a request to `/api/location/data/` the following variables will be extracted:
```console
$1 = "location"
$2 = "data/"
```
And the final request will be `/status/http/location_zones/data/`.
#### NOTE
In Angie PRO, you can separate the [dynamic configuration
API](#api-config) and the immutable [status API](#metrics) that reflects
the current state:
```nginx
location /config/ {
api /config/;
}
location /status/ {
api /status/;
}
```
The path parameter also allows controlling API access:
```nginx
location /status/ {
api /status/;
allow 127.0.0.1;
deny all;
}
```
Or:
```nginx
location /blog/requests/ {
api /status/http/server_zones/blog/requests/;
auth_basic "blog";
auth_basic_user_file conf/htpasswd;
}
```
#### NOTE
If `api` is placed in a `location` with a trailing slash in the prefix
(for example, `location /name/`),
and the [auto_redirect](https://en.angie.software//angie/docs/configuration/modules/http/index.md#auto-redirect) directive is set to `default`,
requests without a trailing slash will be redirected (`/name -> /name/`).
### api_config_files
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `api_config_files` `on` | `off`; |
|------------------------------------------------------------------------------------------|------------------------------------|
| Default | off |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | location |
Enables or disables adding the `config_files` object,
which lists the contents of all Angie configuration files
currently loaded by the server instance,
to the [/status/angie/](#status-angie) API section.
For example, with this configuration:
```nginx
location /status/ {
api /status/;
api_config_files on;
}
```
A request to `/status/angie/` returns approximately the following:
```json
{
"version":"1.12.1",
"address":"192.168.16.5",
"generation":1,
"load_time":"2026-07-17T12:58:39.789Z",
"config_files": {
"/etc/angie/angie.conf": "...",
"/etc/angie/mime.types": "..."
}
}
```
By default, output is disabled because configuration files may contain
particularly sensitive, confidential information.
## Metrics
Angie publishes usage statistics in the `/status/` API section; you can
open access to it by setting the appropriate `location`. Full access:
```nginx
location /status/ {
api /status/;
}
```
Example of partial access, already shown above:
```nginx
location /stats/ {
api /status/http/server_zones/;
}
```
### Example configuration
With a configuration including `location /status/`, `resolver`, `http` in
`upstream`, `http server`, `location`, `cache`, `limit_conn` in
`http` and `limit_req` zones:
```nginx
http {
resolver 127.0.0.53 status_zone=resolver_zone;
proxy_cache_path /var/cache/angie/cache keys_zone=cache_zone:2m;
limit_conn_zone $binary_remote_addr zone=limit_conn_zone:10m;
limit_req_zone $binary_remote_addr zone=limit_req_zone:10m rate=1r/s;
upstream upstream {
zone upstream 256k;
server backend.example.com service=_example._tcp resolve max_conns=5;
keepalive 4;
}
server {
server_name www.example.com;
listen 443 ssl;
status_zone http_server_zone;
proxy_cache cache_zone;
proxy_cache_valid 200 10m;
access_log /var/log/access.log main;
location / {
root /usr/share/angie/html;
status_zone location_zone;
limit_conn limit_conn_zone 1;
limit_req zone=limit_req_zone burst=5;
}
location /status/ {
api /status/;
allow 127.0.0.1;
deny all;
}
}
}
```
In response to the request `curl https://www.example.com/status/`, Angie returns:
### JSON tree
```json
{
"angie": {
"version":"1.12.1",
"address":"192.168.16.5",
"generation":1,
"load_time":"2026-07-17T12:58:39.789Z"
},
"connections": {
"accepted":2257,
"dropped":0,
"active":3,
"idle":1
},
"slabs": {
"cache_zone": {
"pages": {
"used":2,
"free":506
},
"slots": {
"64": {
"used":1,
"free":63,
"reqs":1,
"fails":0
},
"512": {
"used":1,
"free":7,
"reqs":1,
"fails":0
}
}
},
"limit_conn_zone": {
"pages": {
"used":2,
"free":2542
},
"slots": {
"64": {
"used":1,
"free":63,
"reqs":74,
"fails":0
},
"128": {
"used":1,
"free":31,
"reqs":1,
"fails":0
}
}
},
"limit_req_zone": {
"pages": {
"used":2,
"free":2542
},
"slots": {
"64": {
"used":1,
"free":63,
"reqs":1,
"fails":0
},
"128": {
"used":2,
"free":30,
"reqs":3,
"fails":0
}
}
}
},
"http": {
"server_zones": {
"http_server_zone": {
"ssl": {
"handshaked":4174,
"reuses":0,
"timedout":0,
"failed":0
},
"requests": {
"total":4327,
"processing":0,
"discarded":8
},
"responses": {
"200":4305,
"302":12,
"404":4
},
"data": {
"received":733955,
"sent":59207757
}
}
},
"location_zones": {
"location_zone": {
"requests": {
"total":4158,
"discarded":0
},
"responses": {
"200":4157,
"304":1
},
"data": {
"received":538200,
"sent":177606236
}
}
},
"caches": {
"cache_zone": {
"size":0,
"cold":false,
"hit": {
"responses":0,
"bytes":0
},
"stale": {
"responses":0,
"bytes":0
},
"updating": {
"responses":0,
"bytes":0
},
"revalidated": {
"responses":0,
"bytes":0
},
"miss": {
"responses":0,
"bytes":0,
"responses_written":0,
"bytes_written":0
},
"expired": {
"responses":0,
"bytes":0,
"responses_written":0,
"bytes_written":0
},
"bypass": {
"responses":0,
"bytes":0,
"responses_written":0,
"bytes_written":0
}
}
},
"limit_conns": {
"limit_conn_zone": {
"passed":73,
"skipped":0,
"rejected":0,
"exhausted":0
}
},
"limit_reqs": {
"limit_req_zone": {
"passed":54816,
"skipped":0,
"delayed":65,
"rejected":26,
"exhausted":0
}
},
"upstreams": {
"upstream": {
"peers": {
"192.168.16.4:80": {
"server":"backend.example.com",
"service":"_example._tcp",
"backup":false,
"weight":5,
"state":"up",
"selected": {
"current":2,
"total":232
},
"max_conns":5,
"responses": {
"200":222,
"302":12
},
"data": {
"sent":543866,
"received":27349934
},
"health": {
"fails":0,
"unavailable":0,
"downtime":0,
"header_time":21,
"response_time":42
},
"sid":""
}
},
"keepalive":2
}
}
},
"resolvers": {
"resolver_zone": {
"queries": {
"name":442,
"srv":2,
"addr":0
},
"responses": {
"success":440,
"timedout":1,
"format_error":0,
"server_failure":1,
"not_found":1,
"unimplemented":0,
"refused":1,
"other":0
}
}
}
}
```
A set of metrics can be requested by individual JSON branch by constructing the appropriate request. For example:
```console
$ curl https://www.example.com/status/angie
$ curl https://www.example.com/status/connections
$ curl https://www.example.com/status/slabs
$ curl https://www.example.com/status/slabs//slots
$ curl https://www.example.com/status/slabs//slots/64
$ curl https://www.example.com/status/http/
$ curl https://www.example.com/status/http/acme_clients
$ curl https://www.example.com/status/http/acme_clients/
$ curl https://www.example.com/status/http/metric_zones
$ curl https://www.example.com/status/http/metric_zones//metrics
$ curl https://www.example.com/status/http/server_zones
$ curl https://www.example.com/status/http/server_zones/
$ curl https://www.example.com/status/http/server_zones//ssl
```
### Query arguments
The following query-string arguments modify the API's JSON responses:
`pretty`
: By default, the API formats JSON responses with indentation and line breaks.
To get compact, single-line output, add `pretty=off` to the query
string:
```console
$ curl https://www.example.com/status/connections?pretty=off
{"accepted":2257,"dropped":0,"active":3,"idle":1}
```
`date`
: By default, the module uses ISO 8601 format strings for dates; to use the
integer UNIX epoch format instead, add `date=epoch` to the query
string:
```console
$ curl https://www.example.com/status/angie/load_time
"2024-03-31T23:59:59Z"
$ curl https://www.example.com/status/angie/load_time?date=epoch
1711929599
```
The string form is always UTC and carries milliseconds only when they are
non-zero. The epoch form is a whole number of seconds; milliseconds are
never part of it.
`defaults` (PRO)
: You can obtain default parameter values with the `defaults=on` argument:
```console
$ curl http://127.0.0.1/config/http/upstreams/backend/servers?defaults=on
```
```json
{
"backend.example.com": {
"weight": 1,
"max_conns": 5,
"max_fails": 1,
"fail_timeout": 10,
"slow_start": 0,
"backup": false,
"down": false,
"sid": ""
}
}
```
### Server status
#### `/status/angie`
```json
{
"version": "1.12.1",
"build_time": "2026-07-17T16:05:43.805Z",
"address": "192.168.16.5",
"generation": 1,
"load_time": "2026-07-17T16:15:43.805Z"
"config_files": {
"/etc/angie/angie.conf": "...",
"/etc/angie/mime.types": "..."
}
}
```
| `version` | String; version of the running Angie web server |
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `build` | String; particular build name if specified during compilation |
| `build_time` | String; the build time of the Angie executable in the [date](#api-date-format) format |
| `address` | String; the address of the server that accepted the API request |
| `generation` | Number; the generation of the currently loaded configuration, counted from the last start of Angie |
| `load_time` | String; time of the last configuration reload in the [date](#api-date-format) format |
| `config_files` | Object; its members are absolute pathnames of all Angie configuration files that are currently loaded by the server instance, and their values are string representations of the files' contents, for example:
#### WARNING The `config_files` object is available in `/status/angie/` only if the [api_config_files](#a-api-config-files) directive is enabled. |
#### `/status/angie/license` (PRO)
#### Versionadded
Added in version 1.11.0: PRO
```json
{
"path": "/etc/angie/license.pem",
"status": "valid",
"owner": "Example Corp",
"days_left": 30,
"since": "2026-01-01",
"until": "2027-01-01",
"limits": {
"worker_processes": 16,
"worker_connections": 65535
}
}
```
| `path` | String; full path to the license file |
|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `status` | String; license status: `missing`, `invalid`, `valid`, `grace`, `expired`, or `pending` |
| `owner` | String; license owner from the certificate subject |
| `days_left` | Number; days until the license changes state. A negative value means the license has expired, and the value is the number of days since expiration |
| `since` | String; license validity start date |
| `until` | String; license validity end date |
| `limits` | Object; licensed limits for the current instance |
### Connections
#### `/status/connections`
```json
{
"accepted": 2257,
"dropped": 0,
"active": 3,
"idle": 1
}
```
| `accepted` | Number; the total number of accepted client connections |
|--------------|-----------------------------------------------------------|
| `dropped` | Number; the total number of dropped client connections |
| `active` | Number; the current number of active client connections |
| `idle` | Number; the current number of idle client connections |
### Shared memory zones with slab allocation
#### `/status/slabs/`
Usage statistics of shared memory zones that utilize [slab allocation](https://en.wikipedia.org/wiki/Slab_allocation). Any zone that uses slab
allocation is reported, including those of [limit_conn](#limit-conn),
[limit_req](#limit-req), and [HTTP cache](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache), as well as
the shared memory zone of an [HTTP](#a-upstream) or
[stream](#a-s-upstream) upstream:
```nginx
limit_conn_zone $binary_remote_addr zone=limit_conn_zone:10m;
limit_req_zone $binary_remote_addr zone=limit_req_zone:10m rate=1r/s;
proxy_cache cache_zone;
proxy_cache_valid 200 10m;
```
The specified shared memory zone will collect the following statistics:
| `pages` | Object; memory pages statistics. A page here is a system memory page, usually 4K |
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `used` | Number; the number of currently used memory pages |
| `free` | Number; the number of currently free memory pages |
| `slots` | Object; memory slots statistics for each slot size. The `slots` object contains data for memory slot sizes (`8`, `16`, `32`, etc., up to half of the page size in bytes) |
| `used` | Number; the number of currently used memory slots of specified size |
| `free` | Number; the number of currently free memory slots of specified size |
| `reqs` | Number; the total number of attempts to allocate memory of specified size |
| `fails` | Number; the number of unsuccessful attempts to allocate memory of specified size |
Example:
```json
{
"pages": {
"used": 2,
"free": 506
},
"slots": {
"64": {
"used": 1,
"free": 63,
"reqs": 1,
"fails": 0
}
}
```
### DNS queries to resolver
#### `/status/resolvers/`
To collect resolver statistics,
the [resolver](https://en.angie.software//angie/docs/configuration/modules/http/index.md#resolver) directive must set the `status_zone` parameter
([HTTP](https://en.angie.software//angie/docs/configuration/modules/http/index.md#resolver-status) or [Stream](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#s-resolver-status)):
```nginx
resolver 127.0.0.53 status_zone=resolver_zone;
```
The specified shared memory zone will collect the following statistics:
| `queries` | Object; queries statistics |
|------------------|--------------------------------------------------------------------------------------|
| `name` | Number; the number of queries to resolve names to addresses (A and AAAA queries) |
| `srv` | Number; the number of queries to resolve services to addresses (SRV queries) |
| `addr` | Number; the number of queries to resolve addresses to names (PTR queries) |
| `responses` | Object; responses statistics |
| `success` | Number; the number of successful responses |
| `timedout` | Number; the number of timed out queries |
| `format_error` | Number; the number of responses with code 1 (Format Error) |
| `server_failure` | Number; the number of responses with code 2 (Server Failure) |
| `not_found` | Number; the number of responses with code 3 (Name Error) |
| `unimplemented` | Number; the number of responses with code 4 (Not Implemented) |
| `refused` | Number; the number of responses with code 5 (Refused) |
| `other` | Number; the number of queries completed with other non-zero code |
| `sent` | Object; sent DNS queries statistics |
| `a` | Number; the number of A type queries |
| `aaaa` | Number; the number of AAAA type queries |
| `ptr` | Number; the number of PTR type queries |
| `srv` | Number; the number of SRV type queries |
#### NOTE
`queries` and `responses` count every resolution request
Angie makes internally, including those served from the TTL cache.
`sent` counts packets actually dispatched to the name server;
the gap between the two reflects cache hits.
The response codes are described in [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035.html), section [4.1.1](https://datatracker.ietf.org/doc/html/rfc1035.html#section-4.1.1).
Various DNS record types are detailed in [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035.html),
[RFC 2782](https://datatracker.ietf.org/doc/html/rfc2782.html), and
[RFC 3596](https://datatracker.ietf.org/doc/html/rfc3596.html).
Example:
```json
{
"queries": {
"name": 442,
"srv": 2,
"addr": 0
},
"responses": {
"success": 440,
"timedout": 1,
"format_error": 0,
"server_failure": 1,
"not_found": 1,
"unimplemented": 0,
"refused": 1,
"other": 0
},
"sent": {
"a": 185,
"aaaa": 245,
"srv": 2,
"ptr": 12
}
}
```
### HTTP server and location
#### `/status/http/server_zones/`
To collect the `server` metrics,
set the [status_zone](https://en.angie.software//angie/docs/configuration/modules/http/index.md#status-zone) directive in the [server](https://en.angie.software//angie/docs/configuration/modules/http/index.md#server) context:
```nginx
server {
...
status_zone server_zone;
}
```
To group the metrics by a custom value, use the alternative syntax.
Here, the metrics are aggregated by [$host](https://en.angie.software//angie/docs/configuration/modules/http/index.md#v-host),
with each group reported as a standalone zone:
```nginx
status_zone $host zone=server_zone:5;
```
The number after the zone name is a limit on groups, not a memory size
(see [status_zone](https://en.angie.software//angie/docs/configuration/modules/http/index.md#status-zone)); metrics for values beyond the limit are reported
under the zone name itself.
The specified shared memory zone will collect the following statistics:
| `ssl` | Object; SSL statistics. Present if `server` sets `listen ssl;` |
|--------------|----------------------------------------------------------------------------------|
| `handshaked` | Number; the total number of successful SSL handshakes |
| `reuses` | Number; the total number of session reuses during SSL handshake |
| `timedout` | Number; the total number of timed out SSL handshakes |
| `failed` | Number; the total number of failed SSL handshakes |
| `requests` | Object; requests statistics |
| `total` | Number; the total number of client requests |
| `processing` | Number; the number of currently being processed client requests |
| `discarded` | Number; the total number of client requests completed without sending a response |
| `responses` | Object; responses statistics |
| `` | Number; a non-zero number of responses with status (100-599) |
| `xxx` | Number; a non-zero number of responses with other status codes |
| `data` | Object; data statistics |
| `received` | Number; the total number of bytes received from clients |
| `sent` | Number; the total number of bytes sent to clients |
#### NOTE
The `responses` counters track only real responses that were actually
sent to the client. A request whose processing finished without sending a
response is counted in `discarded` and does not increment the
`responses` counters. In particular, `499` is not a response but
an internal service code, recorded only in the access log, that marks a
request whose processing ended without a response being sent; such requests
are reflected in `discarded`, never in `responses`.
Example:
```json
{
"ssl":{
"handshaked":4174,
"reuses":0,
"timedout":0,
"failed":0
},
"requests":{
"total":4327,
"processing":0,
"discarded":0
},
"responses":{
"200":4305,
"302":6,
"304":12,
"404":4
},
"data":{
"received":733955,
"sent":59207757
}
}
```
#### `/status/http/location_zones/`
To collect the `location` metrics, set the [status_zone](https://en.angie.software//angie/docs/configuration/modules/http/index.md#status-zone) directive
in the context of [location](https://en.angie.software//angie/docs/configuration/modules/http/index.md#location) or [if in location](https://en.angie.software//angie/docs/configuration/modules/http/http_rewrite.md#if):
```nginx
location / {
root /usr/share/angie/html;
status_zone location_zone;
if ($request_uri ~* "^/condition") {
# ...
status_zone if_location_zone;
}
}
```
To group the metrics by a custom value, use the alternative syntax.
Here, the metrics are aggregated by [$host](https://en.angie.software//angie/docs/configuration/modules/http/index.md#v-host),
with each group reported as a standalone zone:
```nginx
status_zone $host zone=server_zone:5;
```
The specified shared memory zone will collect the following statistics:
| `requests` | Object; requests statistics |
|--------------|----------------------------------------------------------------------------------|
| `total` | Number; the total number of client requests |
| `discarded` | Number; the total number of client requests completed without sending a response |
| `responses` | Object; responses statistics |
| `` | Number; a non-zero number of responses with status (100-599) |
| `xxx` | Number; a non-zero number of responses with other status codes |
| `data` | Object; data statistics |
| `received` | Number; the total number of bytes received from clients |
| `sent` | Number; the total number of bytes sent to clients |
#### NOTE
The `responses` counters track only real responses that were actually
sent to the client. A request whose processing finished without sending a
response is counted in `discarded` and does not increment the
`responses` counters. In particular, `499` is not a response but
an internal service code, recorded only in the access log, that marks a
request whose processing ended without a response being sent; such requests
are reflected in `discarded`, never in `responses`.
Example:
```json
{
"requests": {
"total": 4158,
"discarded": 0
},
"responses": {
"200": 4157,
"304": 1
},
"data": {
"received": 538200,
"sent": 177606236
}
}
```
#### `/status/http/metric_zones/`
Custom metrics defined by [metric_zone](https://en.angie.software//angie/docs/configuration/modules/http/http_metric.md#metric-zone) or [metric_complex_zone](https://en.angie.software//angie/docs/configuration/modules/http/http_metric.md#metric-complex-zone)
in the `http` context. Metrics are updated with the [metric](https://en.angie.software//angie/docs/configuration/modules/http/http_metric.md#id1)
directive or the module variables.
| `discarded` | Number; the number of metric entries discarded because the zone ran out of memory. |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `metrics` | Object; metrics per key. For single-metric zones, values are numbers. For complex zones, values are objects with metric names. For histogram mode, values are objects with bucket names. |
If `discard_key` is set and some entries have been expired,
their aggregated metrics are exposed under this key.
Example:
```json
{
"discarded": 3,
"metrics": {
"example.com": {
"count": 42,
"max": 8
}
"expired": {
"count": 10,
"max": 3.2
}
}
}
```
### Stream server
#### `/status/stream/server_zones/`
To collect the `server` metrics,
set the [status_zone](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#s-status-zone) directive in the [server](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#s-server) context:
```nginx
server {
...
status_zone server_zone;
}
```
To group the metrics by a custom value, use the alternative syntax.
Here, the metrics are aggregated by [$server_addr](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#v-s-server-addr),
with each group reported as a standalone zone:
```nginx
status_zone $server_addr zone=server_zone:5;
```
The specified shared memory zone will collect the following statistics:
| `ssl` | Object; SSL statistics. Present if `server` sets `listen ssl;` |
|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `handshaked` | Number; the total number of successful SSL handshakes |
| `reuses` | Number; the total number of session reuses during SSL handshake |
| `timedout` | Number; the total number of timed out SSL handshakes |
| `failed` | Number; the total number of failed SSL handshakes |
| `connections` | Object; connections statistics |
| `total` | Number; the total number of client connections |
| `processing` | Number; the number of currently being processed client connections |
| `discarded` | Number; the total number of client connections completed without creating a session |
| `passed` | Number; the total number of client connections relayed to another listening port with `pass` directives |
| `sessions` | Object; sessions statistics |
| `success` | Number; the number of sessions completed with code 200, which means successful completion |
| `invalid` | Number; the number of sessions completed with code 400, which happens when client data could not be parsed, e.g. the PROXY protocol header |
| `forbidden` | Number; the number of sessions completed with code 403, when access was forbidden, for example, when access is limited for certain client addresses |
| `internal_error` | Number; the number of sessions completed with code 500, the internal server error |
| `bad_gateway` | Number; the number of sessions completed with code 502, bad gateway, for example, if an upstream server could not be selected or reached |
| `service_unavailable` | Number; the number of sessions completed with code 503, service unavailable, for example, when access is limited by the number of connections |
| `data` | Object; data statistics |
| `received` | Number; the total number of bytes received from clients |
| `sent` | Number; the total number of bytes sent to clients |
Example:
```json
{
"ssl": {
"handshaked": 24,
"reuses": 0,
"timedout": 0,
"failed": 0
},
"connections": {
"total": 24,
"processing": 1,
"discarded": 0,
"passed": 2
},
"sessions": {
"success": 24,
"invalid": 0,
"forbidden": 0,
"internal_error": 0,
"bad_gateway": 0,
"service_unavailable": 0
},
"data": {
"received": 2762947,
"sent": 53495723
}
}
```
#### `/status/stream/metric_zones/`
Custom metrics defined by [metric_zone](https://en.angie.software//angie/docs/configuration/modules/stream/stream_metric.md#s-metric-zone) or
[metric_complex_zone](https://en.angie.software//angie/docs/configuration/modules/stream/stream_metric.md#s-metric-complex-zone) in the `stream`
context. Metrics are updated with the [metric](https://en.angie.software//angie/docs/configuration/modules/stream/stream_metric.md#s-metric) directive or
the module variables.
| `discarded` | Number; the number of metric entries discarded because the zone ran out of memory. |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `metrics` | Object; metrics per key. For single-metric zones, values are numbers. For complex zones, values are objects with metric names. For histogram mode, values are objects with bucket names. |
If `discard_key` is set and some entries have been expired,
their aggregated metrics are exposed under this key.
Example:
```json
{
"discarded": 3,
"metrics": {
"127.0.0.1": {
"count": 42,
"max": 8
},
"expired": {
"count": 10,
"max": 3.2
}
}
}
```
### HTTP caches
```nginx
proxy_cache cache_zone;
proxy_cache_valid 200 10m;
```
#### `/status/http/caches/`
For each zone configured with [proxy_cache](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache), the following data is
stored:
```json
{
"name_zone": {
"size": 0,
"cold": false,
"hit": {
"responses": 0,
"bytes": 0
},
"stale": {
"responses": 0,
"bytes": 0
},
"updating": {
"responses": 0,
"bytes": 0
},
"revalidated": {
"responses": 0,
"bytes": 0
},
"miss": {
"responses": 0,
"bytes": 0,
"responses_written": 0,
"bytes_written": 0
},
"expired": {
"responses": 0,
"bytes": 0,
"responses_written": 0,
"bytes_written": 0
},
"bypass": {
"responses": 0,
"bytes": 0,
"responses_written": 0,
"bytes_written": 0
}
}
}
```
| `size` | Number; the space the cache currently occupies on disk, in bytes. Each cached entry is counted as the whole filesystem blocks its file occupies, so this value always exceeds the total size of the cached response bodies |
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `max_size` | Number; the configured limit on the cache size, in bytes; omitted if no limit is set |
| `cold` | Boolean; `true` while the cache loader loads data from disk |
| `hit` | Object; statistics of valid cached responses ([proxy_cache_valid](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-valid)) |
| `responses` | Number; the total number of responses read from the cache |
| `bytes` | Number; the total number of bytes read from the cache |
| `stale` | Object; statistics of stale responses taken from the cache ([proxy_cache_use_stale](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-use-stale)) |
| `responses` | Number; the total number of responses read from the cache |
| `bytes` | Number; the total number of bytes read from the cache |
| `updating` | Object; statistics of stale responses taken from the cache while responses were being updated ([proxy_cache_use_stale](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-use-stale) updating) |
| `responses` | Number; the total number of responses read from the cache |
| `bytes` | Number; the total number of bytes read from the cache |
| `revalidated` | Object; statistics of expired and revalidated responses taken from the cache ([proxy_cache_revalidate](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-revalidate)) |
| `responses` | Number; the total number of responses read from the cache |
| `bytes` | Number; the total number of bytes read from the cache |
| `miss` | Object; statistics of responses not found in the cache |
| `responses` | Number; the total number of corresponding responses |
| `bytes` | Number; the total number of bytes read from the proxied server |
| `responses_written` | Number; the total number of responses written to the cache |
| `bytes_written` | Number; the total number of bytes written to the cache |
| `expired` | Object; statistics of expired responses not taken from the cache |
| `responses` | Number; the total number of corresponding responses |
| `bytes` | Number; the total number of bytes read from the proxied server |
| `responses_written` | Number; the total number of responses written to the cache |
| `bytes_written` | Number; the total number of bytes written to the cache |
| `bypass` | Object; statistics of responses not looked up in the cache ([proxy_cache_bypass](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-bypass)) |
| `responses` | Number; the total number of corresponding responses |
| `bytes` | Number; the total number of bytes read from the proxied server |
| `responses_written` | Number; the total number of responses written to the cache |
| `bytes_written` | Number; the total number of bytes written to the cache |
In Angie PRO, if cache sharding is enabled with [proxy_cache_path](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-cache-path) directives,
individual shards are exposed as object members of a `shards` object;
`size`, `max_size`, and `cold` are then reported for each
shard separately and are absent at the zone level:
| `shards` | Object; lists individual shards as members |
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `` | Object; represents an individual shard with its cache path for name |
| `size` | Number; the space the shard currently occupies on disk, in bytes; each cached entry is counted as the whole filesystem blocks its file occupies |
| `max_size` | Number; the configured limit on the shard size, in bytes; omitted if no limit is set |
| `cold` | Boolean; `true` while the cache loader loads data from disk |
```json
{
"name_zone": {
"shards": {
"/path/to/shard1": {
"size": 0,
"cold": false
},
"/path/to/shard2": {
"size": 0,
"cold": false
}
}
}
```
### ACME clients
#### `/status/http/acme_clients/`
For each configured [acme_client](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#acme-client) in the `http` block, returns the
current client and certificate status:
```json
{
"state": "ready",
"certificate": "valid",
"details": "The client is ready to request a certificate.",
"next_run": "2026-07-17T16:15:43.805Z"
}
```
| `state` | String; ACME client state. Possible values: `ready`, `requesting`, `disabled`, `failed`. |
|---------------|------------------------------------------------------------------------------------------------------------------------------------|
| `certificate` | String; certificate status. Possible values: `valid`, `expired`, `missing`, `mismatch`, `error`. |
| `details` | String; short status details from the last ACME operation. |
| `next_run` | Date; next scheduled attempt to request or renew the certificate. Not returned when `state` is `disabled` or `requesting`. |
### limit_conn
```nginx
limit_conn_zone $binary_remote_addr zone=limit_conn_zone:10m;
```
#### `/status/http/limit_conns/`, `/status/stream/limit_conns/`
Objects for each configured [limit_conn in http](#limit-conn) or [limit_conn in stream](https://en.angie.software//angie/docs/configuration/modules/stream/stream_limit_conn.md#s-limit-conn) contexts with the following fields:
```json
{
"passed": 73,
"skipped": 0,
"rejected": 0,
"exhausted": 0
}
```
| `passed` | Number; the total number of passed connections |
|-------------|-------------------------------------------------------------------------------------------------|
| `skipped` | Number; the total number of connections passed with zero-length key, or key exceeding 255 bytes |
| `rejected` | Number; the total number of connections exceeding the configured limit |
| `exhausted` | Number; the total number of connections rejected due to exhaustion of zone storage |
### limit_req
```nginx
limit_req_zone $binary_remote_addr zone=limit_req_zone:10m rate=1r/s;
```
#### `/status/http/limit_reqs/`
Objects for each configured [limit_req](#limit-req) with the following fields:
```json
{
"passed": 54816,
"skipped": 0,
"delayed": 65,
"rejected": 26,
"exhausted": 0
}
```
| `passed` | Number; the total number of passed requests |
|-------------|----------------------------------------------------------------------------------------------|
| `skipped` | Number; the total number of requests passed with zero-length key, or key exceeding 255 bytes |
| `delayed` | Number; the total number of delayed requests |
| `rejected` | Number; the total number of rejected requests |
| `exhausted` | Number; the total number of requests rejected due to exhaustion of zone storage |
### HTTP upstream
To enable collection of the following metrics,
set the [zone](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-zone) directive in the [upstream](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-upstream) context,
for instance:
```nginx
upstream upstream {
zone upstream 256k;
server backend.example.com service=_example._tcp resolve max_conns=5;
keepalive 4;
}
```
The memory usage of this shared memory zone is reported by the
[/status/slabs/](#samp-status-slabs-zone) API section, keyed by the
zone's name.
#### `/status/http/upstreams/`
where is the name of any [upstream](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-upstream) specified with the [zone](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-zone) directive
```json
{
"peers": {
"192.168.16.4:80": {
"server": "backend.example.com",
"service": "_example._tcp",
"backup": false,
"weight": 5,
"state": "up",
"selected": {
"current": 2,
"total": 232
},
"max_conns": 5,
"responses": {
"200": 222,
"302": 12
},
"data": {
"sent": 543866,
"received": 27349934
},
"health": {
"fails": 0,
"unavailable": 0,
"downtime": 0,
"header_time": 21,
"response_time": 42
},
"sid": ""
}
},
"keepalive": 2
}
```
| `peers` | Object; contains the metrics of the upstream's peers as subobjects whose names are canonical representations of the peers' addresses. Members of each subobject: |
|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `server` | String; the parameter of the [server](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server) directive |
| `service` | String; name of service as it's specified in [server](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server) directive, if configured |
| `backup` | Boolean; `true` for backup servers |
| `weight` | Number; configured [weight](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server) |
| `state` | String; the current state of the peer and what requests are sent to it:
- `busy`: indicates that the number of requests to the server has reached the limit set by [max_conns](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server), and no new requests are sent to it; - `down`: manually disabled, no requests are sent; - `draining`: similar to `down`, but requests from previously bound sessions (via [sticky](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-sticky)) are still sent; - `recovering`: recovering after a failure according to [slow_start](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#slow-start), more and more requests are sent over time; - `unavailable`: reached the [max_fails](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#max-fails) limit, only trial client requests are sent at intervals defined by [fail_timeout](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#fail-timeout); - `up`: operational, requests are sent as usual;
Additional states in Angie PRO:
- `checking`: configured as `essential` and being checked, only [probe requests](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream_probe.md#u-upstream-probe) are sent; - `unhealthy`: non-operational, only [probe requests](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream_probe.md#u-upstream-probe) are sent. |
| `selected` | Object; peer selection statistics |
| `current` | Number; the current number of connections to the peer |
| `total` | Number; total number of requests forwarded to the peer |
| `last` | String or number; time when the peer was last selected, formatted as a [date](#api-date-format) |
| `max_conns` | Number; the configured [maximum](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server) number of simultaneous active connections to the peer, if specified |
| `responses` | Object; response statistics |
| `` | Number; a non-zero number of responses with status (100-599) |
| `xxx` | Number; a non-zero number of responses with other status codes |
| `data` | Object; data statistics |
| `received` | Number; the total number of bytes received from the peer |
| `sent` | Number; the total number of bytes sent to the peer |
| `health` | Object; health statistics |
| `fails` | Number; the total number of unsuccessful attempts to communicate with the peer |
| `unavailable` | Number; how many times the peer became `unavailable` due to reaching the [max_fails](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#max-fails) limit |
| `downtime` | Number; the total time (in milliseconds) when the peer was `unavailable` for selection |
| `downstart` | String or number; time when the peer became `unavailable`, formatted as a [date](#api-date-format). This field is present only while the peer is in the `unavailable` state; otherwise it is absent |
| `header_time` | Number; average time (in milliseconds) to receive the response headers from the server; see [response_time_factor](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-response-time-factor) |
| `response_time` | Number; average time (in milliseconds) to receive the entire response from the server; see [response_time_factor](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-response-time-factor) |
| `sid` | String; [configured id](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#reresolve) of the server in the upstream group |
| `feedback` (PRO) | Number; the current average feedback value used by the [feedback](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-feedback) load balancing method, present only when this method is used |
| `keepalive` | Number; the current number of cached connections |
| `backup_switch` | Object; contains the current state of the active backup logic, present if [backup_switch (PRO)](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-backup-switch) is configured for the upstream |
| `active` | Number; the level of the active group that is currently used for load balancing requests. If the active group is the primary one, the value is 0 |
| `timeout` | Number; remaining wait time in milliseconds, after which the balancer will re-check for healthy nodes in groups with lower levels, starting from the primary group, while groups with higher levels are not checked; not displayed for the primary group (level 0) |
##### `health/probes` (PRO)
If the upstream has [upstream_probe (PRO)](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream_probe.md#u-upstream-probe) probes configured,
the `health` object also has a `probes` subobject
that stores the server's health probe counters,
while `state`, apart from the values listed in the table above,
can also be `checking` and `unhealthy`:
```json
{
"192.168.16.4:80": {
"state": "unhealthy",
"...": "...",
"health": {
"...": "...",
"probes": {
"count": 10,
"fails": 10,
"last": "2026-07-17T09:56:07Z"
}
}
}
}
```
The `checking` value of `state` isn't counted as `downtime`
and means that the server, which has a probe configured as `essential`,
hasn't been checked yet;
the `unhealthy` value means that the server is malfunctioning.
Both states also imply that the server isn't included in load balancing.
For details of health probes, see [upstream_probe](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream_probe.md#u-upstream-probe).
Counters in `probes`:
| `count` | Number; total probes for this server |
|-----------|--------------------------------------------------------------------------------|
| `fails` | Number; total failed probes |
| `last` | String or number; last probe time, formatted as a [date](#api-date-format) |
##### `queue` (PRO)
If a [request queue](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-queue) is configured for the upstream,
the upstream object also contains a nested `queue` object
with request queue counters:
```json
{
"queue": {
"queued": 20112,
"waiting": 1011,
"dropped": 6031,
"timedout": 560,
"overflows": 13
}
}
```
Counter values are summed across all worker processes:
| `queued` | Number; total number of requests that entered the queue |
|-------------|------------------------------------------------------------------------------------------------------------------|
| `waiting` | Number; current number of requests in the queue |
| `dropped` | Number; total number of requests removed from the queue because the client prematurely closed the connection |
| `timedout` | Number; total number of requests removed from the queue due to timeout |
| `overflows` | Number; total number of queue overflow occurrences |
### Stream upstream
To enable collection of the following metrics,
set the [zone](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-zone) directive in the [upstream](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-upstream) context,
for instance:
```nginx
upstream upstream {
zone upstream 256k;
server backend.example.com service=_example._tcp resolve max_conns=5;
keepalive 4;
}
```
The memory usage of this shared memory zone is reported by the
[/status/slabs/](#samp-status-slabs-zone) API section, keyed by the
zone's name.
#### `/status/stream/upstreams/`
Here, is the name of an [upstream](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-upstream) that is
configured with a [zone](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-zone) directive.
```json
{
"peers": {
"192.168.16.4:1935": {
"server": "backend.example.com",
"service": "_example._tcp",
"backup": false,
"weight": 5,
"state": "up",
"selected": {
"current": 2,
"total": 232
},
"max_conns": 5,
"data": {
"sent": 543866,
"received": 27349934
},
"health": {
"fails": 0,
"unavailable": 0,
"downtime": 0,
"connect_time": 3,
"first_byte_time": 21,
"last_byte_time": 42
}
}
}
}
```
| `peers` | Object; contains the metrics of the upstream's peers as subobjects whose names are canonical representations of the peers' addresses. Members of each subobject: |
|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `server` | String; address set by the [server](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-server) directive |
| `service` | String; service name, if set by the [server](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-server) directive |
| `backup` | Boolean; `true` for backup servers |
| `weight` | Number; the [weight](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-server) set for the peer |
| `state` | String; the current state of the peer and what requests are sent to it:
- `busy`: indicates that the number of requests to the server has reached the limit set by [max_conns](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-server), and no new requests are sent to it - `down`: manually disabled, no requests are sent - `draining`: similar to `down`, but requests from previously bound sessions (via [sticky](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-sticky)) are still sent - `recovering`: recovering after a failure according to [slow_start](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-slow-start), more and more requests are sent over time - `unavailable`: reached the [max_fails](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-max-fails) limit, only trial client requests are sent at intervals defined by [fail_timeout](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-fail-timeout) - `up`: operational, requests are sent as usual
Additional states in Angie PRO:
- `checking`: configured as `essential` and being checked, only [probe requests](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream_probe.md#s-u-upstream-probe) are sent - `unhealthy`: non-operational, only [probe requests](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream_probe.md#s-u-upstream-probe) are sent |
| `selected` | Object; statistics on selecting this peer for connections |
| `current` | Number; current number of connections to the peer |
| `total` | Number; total number of connections forwarded to the peer |
| `last` | String or number; time when the peer was last selected, formatted as a [date](#api-date-format) |
| `max_conns` | Number; [maximum](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-server) number of simultaneous active connections to the peer, if set |
| `data` | Object; data transfer statistics |
| `received` | Number; total bytes received from the peer |
| `sent` | Number; total bytes sent to the peer |
| `health` | Object; peer health statistics |
| `fails` | Number; total failed attempts to reach the peer |
| `unavailable` | Number; total number of times the peer became `unavailable` due to reaching the [max_fails](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-max-fails) value |
| `downtime` | Number; total time (in milliseconds) that the peer was `unavailable` (unavailable for selection) |
| `downstart` | String or number; time when the peer last became `unavailable`, formatted as a [date](#api-date-format). This field is present only while the peer is in the `unavailable` state; otherwise it is absent |
| `connect_time` | Number; average time (in milliseconds) to establish a connection with the server; see the [response_time_factor](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-response-time-factor) directive |
| `first_byte_time` | Number; average time (in milliseconds) to receive the first byte of the response from the server; see the [response_time_factor](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-response-time-factor) directive |
| `last_byte_time` | Number; average time (in milliseconds) to receive the complete response from the server; see the [response_time_factor](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-response-time-factor) directive |
| `feedback` (PRO) | Number; the current average feedback value used by the [feedback](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-feedback) load balancing method, present only when this method is used |
| `backup_switch` (PRO 1.10.0+) | Object; contains the current state of active backup logic, present if [backup_switch (PRO)](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-backup-switch) is configured for the upstream |
| `active` | Number; level of the active group currently used for load balancing. If the active group is the primary group, the value is 0 |
| `timeout` | Number; remaining wait time in milliseconds after which the load balancer will recheck for healthy nodes in groups with lower levels, starting from the primary group, while groups with higher levels are not checked; not displayed for the primary group (level 0) |
In Angie PRO, if the upstream has [upstream_probe (PRO)](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream_probe.md#s-u-upstream-probe) probes configured,
the `health` object also has a `probes` subobject
that stores the server's health probe counters,
while `state`, in addition to the values from the table above,
can also be `checking` and `unhealthy`:
```json
{
"192.168.16.4:80": {
"state": "unhealthy",
"...": "...",
"health": {
"...": "...",
"probes": {
"count": 2,
"fails": 2,
"last": "2026-07-17T11:03:54Z"
}
}
}
}
```
The `checking` value of `state` means that the server,
which has a probe configured with the `essential` parameter,
hasn't been checked yet;
the `unhealthy` value means that the server is non-operational.
Both states also mean that the server isn't included in load balancing.
For details of health probes, see [upstream_probe](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream_probe.md#s-u-upstream-probe).
Counters in `probes`:
| `count` | Number; total number of probes for this server |
|-----------|---------------------------------------------------------------------------------------|
| `fails` | Number; number of failed probes |
| `last` | String or number; time of the last probe, formatted as a [date](#api-date-format) |
## Certificates
### `/certificates/`
A top-level object of the API, separate from the [/status/](#metrics)
statistics tree, that reports the TLS certificates Angie has loaded.
A certificate isn't listed under `static` if its certificate or key file
name contains a variable — including one supplied by an ACME client through
the [$acme_cert_](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#v-acme-cert-name) variable. A certificate
shared by several servers is listed once.
The following example loads a static certificate and obtains another
certificate with an ACME client. The ACME client requires a configured
[resolver](https://en.angie.software//angie/docs/configuration/modules/http/index.md#resolver) to resolve the directory hostname:
```nginx
http {
resolver 127.0.0.53;
acme_client example https://acme.example.com/directory;
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate example.com.crt;
ssl_certificate_key example.com.key;
location /certificates/ {
api /certificates/;
}
}
server {
listen 443 ssl;
server_name acme.example.com;
acme example;
ssl_certificate $acme_cert_example;
ssl_certificate_key $acme_cert_key_example;
}
}
```
In response to the request
`curl https://www.example.com/certificates/`, Angie returns:
```json
{
"static": {
"example.com.crt": {
"key": "RSA (2048 bits)",
"chain": [
{
"subject": {
"common_name": "example.com",
"alt_names": [
"example.com",
"www.example.com"
],
"organization": "Example, Inc."
},
"issuer": {
"common_name": "Example Root CA",
"country": "US",
"organization": "Example, Inc."
},
"validity": {
"since": "Sep 18 19:46:19 2022 GMT",
"until": "Jun 15 19:46:19 2025 GMT"
}
}
]
}
},
"acme_clients": {
"example": {
"key": "EC (prime256v1)",
"chain": [
{
"subject": {
"common_name": "acme.example.com"
},
"issuer": {
"common_name": "Example ACME CA"
},
"validity": {
"since": "Sep 18 19:46:19 2022 GMT",
"until": "Dec 17 19:46:19 2022 GMT"
}
}
]
}
}
}
```
| `static` | Object; server certificates set with [ssl_certificate](https://en.angie.software//angie/docs/configuration/modules/http/http_ssl.md#ssl-certificate) in HTTP, [ssl_certificate](https://en.angie.software//angie/docs/configuration/modules/stream/stream_ssl.md#s-ssl-certificate) in Stream, or [ssl_certificate](https://en.angie.software//angie/docs/configuration/modules/mail/mail_ssl.md#m-ssl-certificate) in Mail, each keyed by the certificate file name. In builds with `--with-ntls`, it also includes certificates set with [proxy_ssl_certificate](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-ssl-certificate) in HTTP or [proxy_ssl_certificate](https://en.angie.software//angie/docs/configuration/modules/stream/stream_proxy.md#s-proxy-ssl-certificate) in Stream for authenticating to proxied servers |
|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `acme_clients` | Object; available when Angie is built with the HTTP [ACME](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#http-acme) module, which is also required by the Stream [ACME](https://en.angie.software//angie/docs/configuration/modules/stream/stream_acme.md#stream-acme) module. Contains certificates obtained by [ACME clients](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#acme-client) for HTTP and Stream servers. Each entry is keyed by the [acme_client](https://en.angie.software//angie/docs/configuration/modules/http/http_acme.md#acme-client) name. Only clients that have already obtained a certificate are listed |
Each entry of `static` and `acme_clients` describes a single
certificate bundle:
| `key` | String; private key type and size (or curve), for example `RSA (2048 bits)`, `EC (prime256v1)`, or `DH (2048 bits)` |
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `chain` | Array; the certificates of the bundle, starting with the leaf (server) certificate followed by any intermediate certificates, toward the root. Each element is an object describing one certificate: |
| `subject` | Object; the subject distinguished name |
| `common_name` | String; Common Name (`CN`) |
| `alt_names` | Array of strings; the DNS names and IP addresses from the Subject Alternative Name extension |
| `country` | String; Country (`C`) |
| `state_or_province` | String; State or Province Name (`ST`) |
| `organization` | String; Organization (`O`) |
| `issuer` | Object; the issuer distinguished name, with the same fields as `subject` |
| `validity` | Object; the certificate validity period |
| `since` | String; start of the validity period (`notBefore`) |
| `until` | String; end of the validity period (`notAfter`) |
The fields of `subject` and `issuer` appear only when present in the
certificate.
## Dynamic Configuration API (PRO)
The API includes a `/config` section that enables dynamic updates
to Angie's configuration in JSON format
with `PUT`, `PATCH`, and `DELETE` HTTP requests.
All updates are atomic: new settings are applied as a whole,
or none are applied at all.
On error, Angie reports the reason.
### Subsections of `/config`
Currently, configuration of individual servers within upstreams is available
in the `/config` section for the [HTTP](#api-config-http-upstreams-servers) and [stream](#api-config-stream-upstreams-servers) modules; the number of settings
eligible for dynamic configuration is steadily increasing.
#### `/config/http/upstreams//servers/`
Enables configuring individual upstream peers,
including deleting existing peers or adding new ones.
URI path parameters:
| `` | Name of the upstream; to be configurable via `/config`, it must have a [zone](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-zone) directive configured, defining a shared memory zone. |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `` | The peer's name within the upstream, defined as `@`, where:
- `@` is an optional service name, used for SRV record resolution. - `` is the domain name of the service (if `resolve` is present) or its IP; an optional port can be defined here. |
For example, the following configuration:
```nginx
upstream backend {
server backend.example.com service=_http._tcp resolve;
server 127.0.0.1;
zone backend 1m;
}
```
Allows the following peer names:
```console
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/_http._tcp@backend.example.com/
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/127.0.0.1:80/
```
This API subsection enables setting the `weight`, `max_conns`,
`max_fails`, `fail_timeout`, `slow_start`, `backup`, `down` and
`sid` parameters, as described in [server](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-server).
#### NOTE
There is no separate `drain` parameter here;
to enable `drain`,
set `down` to the string value `drain`:
```console
$ curl -X PUT -d \"drain\" \
http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com/down
```
Example:
```console
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com?defaults=on
```
```json
{
"weight": 1,
"max_conns": 0,
"max_fails": 1,
"fail_timeout": 10,
"slow_start": 0,
"backup": true,
"down": false,
"sid": ""
}
```
Actually available parameters are limited to the ones supported by the
current load balancing method of the [upstream](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-upstream).
So, if the upstream is configured with the `random` method:
```nginx
upstream backend {
zone backend 256k;
server backend.example.com resolve max_conns=5;
random;
}
```
You will be unable to add a new peer that defines `backup`:
```console
$ curl -X PUT -d '{ "backup": true }' \
http://127.0.0.1/config/http/upstreams/backend/servers/backend1.example.com
```
```json
{
"error": "FormatError",
"description": "The \"backup\" field is unknown."
}
```
#### `/config/stream/upstreams//servers/`
Enables configuring individual upstream peers,
including deleting existing peers or adding new ones.
URI path parameters:
| `` | Name of the `upstream` block; to be configurable via `/config`, it must have a [zone](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-zone) directive configured, defining a shared memory zone. |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `` | The peer's name within the upstream, defined as `@`, where:
- `@` is an optional service name, used for SRV record resolution. - `` is the domain name of the service (if `resolve` is present) or its IP; an optional port can be defined here. |
For example, the following configuration:
```nginx
upstream backend {
server backend.example.com:8080 service=_example._tcp resolve;
server 127.0.0.1:12345;
zone backend 1m;
}
```
Allows the following peer names:
```console
$ curl http://127.0.0.1/config/stream/upstreams/backend/servers/_example._tcp@backend.example.com:8080/
$ curl http://127.0.0.1/config/stream/upstreams/backend/servers/127.0.0.1:12345/
```
This API subsection enables setting the `weight`,
`max_conns`, `max_fails`, `fail_timeout`, `slow_start`, `backup`, and
`down` parameters, as described in [server](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-server).
#### NOTE
There is no separate `drain` parameter here;
to enable `drain` mode,
set `down` to the string value `drain`:
```console
$ curl -X PUT -d \"drain\" \
http://127.0.0.1/config/stream/upstreams/backend/servers/backend.example.com/down
```
Example:
```console
$ curl http://127.0.0.1/config/stream/upstreams/backend/servers/backend.example.com?defaults=on
```
```json
{
"weight": 1,
"max_conns": 0,
"max_fails": 1,
"fail_timeout": 10,
"slow_start": 0,
"backup": true,
"down": false,
}
```
Actually available parameters are limited to the ones supported by the
current load balancing method of the [upstream](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-upstream).
So, if the upstream is configured with the `random` method:
```nginx
upstream backend {
zone backend 256k;
server backend.example.com resolve max_conns=5;
random;
}
```
You will be unable to add a new peer that defines `backup`:
```console
$ curl -X PUT -d '{ "backup": true }' \
http://127.0.0.1/config/stream/upstreams/backend/servers/backend1.example.com
```
```json
{
"error": "FormatError",
"description": "The \"backup\" field is unknown."
}
```
When deleting peers, you can set the
`connection_drop=` argument (PRO) to override the
[proxy_connection_drop](https://en.angie.software//angie/docs/configuration/modules/stream/stream_proxy.md#s-proxy-connection-drop) settings:
```console
$ curl -X DELETE \
http://127.0.0.1/config/stream/upstreams/backend/servers/backend1.example.com?connection_drop=off
$ curl -X DELETE \
http://127.0.0.1/config/stream/upstreams/backend/servers/backend2.example.com?connection_drop=on
$ curl -X DELETE \
http://127.0.0.1/config/stream/upstreams/backend/servers/backend3.example.com?connection_drop=1000
```
### HTTP Methods
Let's consider the semantics of each HTTP method applicable to this section
using the following upstream configuration as an example:
```nginx
http {
# ...
upstream backend {
zone upstream 256k;
server backend.example.com resolve max_conns=5;
# ...
}
server {
# ...
location /config/ {
api /config/;
allow 127.0.0.1;
deny all;
}
}
}
```
#### GET
The `GET` HTTP method queries an entity at any existing path within
`/config`, just as it does for other API sections.
For example, the
`/config/http/upstreams/backend/servers/`
upstream server branch enables these queries:
```console
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com/max_conns
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com
$ curl http://127.0.0.1/config/http/upstreams/backend/servers
$ # ...
$ curl http://127.0.0.1/config
```
You can obtain default parameter values with the `defaults=on` query
argument; see [Query arguments](#api-query-arguments).
#### PUT
The `PUT` HTTP method creates a new JSON entity at the specified path
or *entirely* replaces an existing one.
For example, to add the `max_fails` parameter, not specified earlier,
to the `backend.example.com` server within the `backend` upstream:
```console
$ curl -X PUT -d '2' \
http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com/max_fails
```
```json
{
"success": "Updated",
"description": "Existing configuration API entity \"/config/http/upstreams/backend/servers/backend.example.com/max_fails\" was updated with replacing."
}
```
Verify the changes:
```console
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com
```
```json
{
"max_conns": 5,
"max_fails": 2
}
```
#### DELETE
The `DELETE` HTTP method deletes *previously defined* settings at the specified path;
in doing so, it restores the default values if there are any.
For example, to delete the previously modified `max_fails` parameter
of the `backend.example.com` server within the `backend` upstream:
```console
$ curl -X DELETE \
http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com/max_fails
```
```console
{
"success": "Reset",
"description": "Configuration API entity \"/config/http/upstreams/backend/servers/backend.example.com/max_fails\" was reset to default."
}
```
Verify the changes using the `defaults=on` argument:
```console
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com?defaults=on
```
```json
{
"weight": 1,
"max_conns": 5,
"max_fails": 1,
"fail_timeout": 10,
"slow_start": 0,
"backup": false,
"down": false,
"sid": ""
}
```
The `max_fails` parameter has returned to its default value.
When deleting servers, you can set the `connection_drop=` argument
(PRO) to override the [proxy_connection_drop](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-connection-drop), [grpc_connection_drop](https://en.angie.software//angie/docs/configuration/modules/http/http_grpc.md#grpc-connection-drop),
[fastcgi_connection_drop](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-connection-drop), [scgi_connection_drop](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#scgi-connection-drop), and
[uwsgi_connection_drop](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#uwsgi-connection-drop) settings:
```console
$ curl -X DELETE \
http://127.0.0.1/config/http/upstreams/backend/servers/backend1.example.com?connection_drop=off
$ curl -X DELETE \
http://127.0.0.1/config/http/upstreams/backend/servers/backend2.example.com?connection_drop=on
$ curl -X DELETE \
http://127.0.0.1/config/http/upstreams/backend/servers/backend3.example.com?connection_drop=1000
```
#### PATCH
The `PATCH` HTTP method creates a new entity at the specified path
or partially replaces or complements an existing one
([RFC 7386](https://datatracker.ietf.org/doc/html/rfc7396))
by supplying a JSON definition in its payload.
The method operates as follows: if the entities from the new definition
exist in the configuration, they are overwritten; otherwise, they are added.
For example, to change the `down` parameter of the
`backend.example.com` server within the `backend` upstream,
leaving the rest intact:
```console
$ curl -X PATCH -d '{ "down": true }' \
http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com
```
```json
{
"success": "Updated",
"description": "Existing configuration API entity \"/config/http/upstreams/backend/servers/backend.example.com\" was updated with merging."
}
```
Verify the changes:
```console
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com
```
```json
{
"max_conns": 5,
"down": true
}
```
Note that the JSON object supplied with the `PATCH` request *was merged* with the
existing one instead of replacing it entirely, as would be the case with `PUT`.
The `null` values are a special case; they are used to delete
specific configuration items during such a merge.
#### NOTE
This deletion is identical to `DELETE`;
in particular, it restores the default values.
For example, to delete the `down` parameter added earlier
and simultaneously update `max_conns`:
```console
$ curl -X PATCH -d '{ "down": null, "max_conns": 6 }' \
http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com
```
```json
{
"success": "Updated",
"description": "Existing configuration API entity \"/config/http/upstreams/backend/servers/backend.example.com\" was updated with merging."
}
```
Verify the changes:
```console
$ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com
```
```json
{
"max_conns": 6
}
```
The `down` parameter, for which a `null` value was supplied, was deleted;
the `max_conns` value was updated.
# https://en.angie.software/angie/docs/configuration/modules/http/http_auth_basic.md
# Auth Basic
Allows limiting access to resources by validating the user name and password using the "HTTP Basic Authentication" protocol.
Access can also be limited by [address](https://en.angie.software//angie/docs/configuration/modules/http/http_access.md#http-access) or by the
[result of subrequest](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_request.md#http-auth-request). Simultaneous limitation of
access by address and by password is controlled by the [satisfy](https://en.angie.software//angie/docs/configuration/modules/http/index.md#satisfy) directive.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module is built by
default; it can be disabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--without-http_auth_basic_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
## Configuration Example
```nginx
location / {
auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
}
```
## Directives
### auth_basic
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `auth_basic` string | `off`; |
|------------------------------------------------------------------------------------------|--------------------------------------|
| Default | `auth_basic off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, limit_except |
Enables validation of user name and password using the "HTTP Basic Authentication" protocol. The specified parameter is used as a realm. Parameter value can contain [variables](https://en.angie.software//angie/docs/configuration/configfile.md#string-variables).
| `off` | cancels the effect of the auth_basic directive inherited from the previous configuration level |
|---------|--------------------------------------------------------------------------------------------------|
### auth_basic_user_file
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `auth_basic_user_file` file; |
|------------------------------------------------------------------------------------------|--------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, limit_except |
Specifies a file that keeps user names and passwords. The format is as follows:
```none
# comment
name1:password1
name2:password2:comment
name3:password3
```
The file name can contain variables.
The following password types are supported:
* encrypted with the crypt() function; can be generated using the `htpasswd` utility from the Apache HTTP Server distribution or the "openssl passwd" command;
* hashed with the Apache variant of the MD5-based password algorithm (apr1); can be generated with the same tools;
* specified by the "{scheme}data" syntax as described in [RFC 2307](https://datatracker.ietf.org/doc/html/rfc2307#section-5.3); currently implemented schemes include PLAIN (an example one, should not be used), SHA (plain SHA-1 hashing, should not be used) and SSHA (salted SHA-1 hashing, used by some software packages, notably OpenLDAP and Dovecot).
#### WARNING
Support for SHA scheme was added only to aid in migration from other web servers. It should not be used for new passwords, since unsalted SHA-1 hashing that it employs is vulnerable to [rainbow table](http://en.wikipedia.org/wiki/Rainbow_attack) attacks.
# https://en.angie.software/angie/docs/configuration/modules/http/http_auth_request.md
# Auth Request
Implements client authorization based on the result of a subrequest. If the subrequest returns a 2xx response code, the access is allowed. If it returns 401 or 403, the access is denied with the corresponding error code. Any other response code returned by the subrequest is considered an error.
For the 401 error, the client also receives the `WWW-Authenticate` header from the subrequest response.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module isn't built
by default; it must be enabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--with-http_auth_request_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
The module may be combined with other access modules, such as
[Access](https://en.angie.software//angie/docs/configuration/modules/http/http_access.md#http-access) and [Auth Basic](https://en.angie.software//angie/docs/configuration/modules/http/http_auth_basic.md#http-auth-basic), via the [satisfy](https://en.angie.software//angie/docs/configuration/modules/http/index.md#satisfy)
directive.
## Configuration Example
```nginx
location /private/ {
auth_request /auth;
# ...
}
location = /auth {
proxy_pass ...;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
```
## Directives
### auth_request
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `auth_request` `uri` | `off`; |
|------------------------------------------------------------------------------------------|---------------------------------|
| Default | `auth_request off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables authorization based on the result of a subrequest and sets the URI to which the subrequest will be sent.
### auth_request_set
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `auth_request_set` $variable value; |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the request variable to the given value after the authorization request completes. The value may contain [variables](https://en.angie.software//angie/docs/configuration/configfile.md#string-variables) from the authorization request, such as `$upstream_http_*`.
# https://en.angie.software/angie/docs/configuration/modules/http/http_autoindex.md
# AutoIndex
Serves requests ending with a slash (`/`) and produces a directory listing. Usually, a request is passed to the `AutoIndex` module when the [Index](https://en.angie.software//angie/docs/configuration/modules/http/http_index.md#http-index) module cannot find an index file.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module is built by
default; it can be disabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--without-http_autoindex_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
## Configuration Example
```nginx
location / {
autoindex on;
}
```
## Directives
### autoindex
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `autoindex` `on` | `off`; |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default | `autoindex off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables or disables the directory listing output.
### autoindex_exact_size
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `autoindex_exact_size` `on` | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default | `autoindex_exact_size on;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
For the HTML [format](#autoindex-format), specifies whether exact file sizes should be output in the directory listing, or rather rounded to kilobytes, megabytes, and gigabytes.
### autoindex_format
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `autoindex_format` `html` | `xml` | `json` | `jsonp`; |
|------------------------------------------------------------------------------------------|---------------------------------------------------------|
| Default | `autoindex_format html;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets the format of a directory listing.
When the JSONP format is used, the name of a callback function is set with the `callback` request argument. If the argument is missing or has an empty value, then the JSON format is used.
The XML output can be transformed using the [XSLT](https://en.angie.software//angie/docs/configuration/modules/http/http_xslt.md#http-xslt) module.
### Output Formats
Object fields in responses contain the following data:
| Field | Description |
|---------|-----------------------------------------------------------------------------------------------------------------------------------|
| `name` | File or directory name |
| `type` | Object type: `file` or `directory` |
| `size` | File size in bytes; omitted for directories. [autoindex_exact_size](#autoindex-exact-size) affects only the `html` format |
| `mtime` | Last modification time in Unix time format |
HTML
```html
Index of /files/
```
XML
```xml
example.txtfile12342025-06-12T14:21:00Zimage.pngfile43212025-06-12T14:21:00Z
```
JSON
```json
[
{
"name": "example.txt",
"type": "file",
"size": 1234,
"mtime": "2025-06-12T14:21:00Z"
},
{
"name": "image.png",
"type": "file",
"size": 4321,
"mtime": "2025-06-12T14:21:00Z"
}
]
```
JSONP
```javascript
callback([
{
"name": "example.txt",
"type": "file",
"size": 1234,
"mtime": "2025-06-12T14:21:00Z"
},
{
"name": "image.png",
"type": "file",
"size": 4321,
"mtime": "2025-06-12T14:21:00Z"
}
]);
```
### autoindex_localtime
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `autoindex_localtime` `on` | `off`; |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default | `autoindex_localtime off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
For the HTML [format](#autoindex-format), specifies whether times in the directory listing should be output in the local time zone or UTC.
# https://en.angie.software/angie/docs/configuration/modules/http/http_browser.md
# Browser
The module creates variables whose values depend on the value of the `User-Agent` request header field.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module is built by
default; it can be disabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--without-http_browser_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
## Variables
### `$ancient_browser`
equals the value set by the [ancient_browser_value](#ancient-browser-value) directive, if a browser was identified as ancient;
### `$modern_browser`
equals the value set by the [modern_browser_value](#modern-browser-value) directive, if a browser was identified as modern;
### `$msie`
equals "1" if a browser was identified as MSIE of any version.
## Configuration Example
### Choosing an index file:
```nginx
modern_browser_value "modern.";
modern_browser msie 5.5;
modern_browser gecko 1.0.0;
modern_browser opera 9.0;
modern_browser safari 413;
modern_browser konqueror 3.0;
index index.${modern_browser}html index.html;
```
### Redirection for old browsers:
```nginx
modern_browser msie 5.0;
modern_browser gecko 0.9.1;
modern_browser opera 8.0;
modern_browser safari 413;
modern_browser konqueror 3.0;
modern_browser unlisted;
ancient_browser Links Lynx netscape4;
if ($ancient_browser) {
rewrite ^ /ancient.html;
}
```
## Directives
### ancient_browser
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `ancient_browser` string ...; |
|------------------------------------------------------------------------------------------|---------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
If any of the specified substrings is found in the `User-Agent` request header field, the browser will be considered ancient. The special string "netscape4" corresponds to the regular expression "^Mozilla/[1-4]".
### ancient_browser_value
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `ancient_browser_value` string; |
|------------------------------------------------------------------------------------------|-----------------------------------|
| Default | `ancient_browser_value 1;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets a value for the [$ancient_browser](#v-ancient-browser) variable.
### modern_browser
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `modern_browser` browser version;
`modern_browser` `unlisted`; |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Specifies a version starting from which a browser is considered modern. A
browser can be any one of the following: `msie`, `gecko` (browsers
based on Mozilla), `opera`, `safari`, or `konqueror`.
Versions can be specified in the following formats: X, X.X, X.X.X, or X.X.X.X. The maximum values for each of the formats are 4000, 4000.99, 4000.99.99, and 4000.99.99.99, respectively.
The special value `unlisted` specifies to consider a browser as modern if it was not listed by the modern_browser and [ancient_browser](#id4) directives. Otherwise such a browser is considered ancient. If a request does not provide the `User-Agent` field in the header, the browser is treated as not being listed.
### modern_browser_value
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `modern_browser_value` string; |
|------------------------------------------------------------------------------------------|----------------------------------|
| Default | `modern_browser_value 1;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets a value for the [$modern_browser](#v-modern-browser) variable.
# https://en.angie.software/angie/docs/configuration/modules/http/http_charset.md
# Charset
The module adds the specified charset to the `Content-Type` response header field. In addition, the module can convert data from one charset to another, with some limitations:
* conversion is performed one way — from server to client,
* only single-byte charsets can be converted
* or single-byte charsets to/from UTF-8.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module is built by
default; it can be disabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--without-http_charset_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
## Configuration Example
```nginx
include conf/koi-win;
charset windows-1251;
source_charset koi8-r;
```
## Directives
### charset
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `charset` charset | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default | `charset off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, if in location |
Adds the specified charset to the `Content-Type` response header field. If this charset is different from the charset specified in the [source_charset](#source-charset) directive, a conversion is performed.
The parameter `off` cancels the addition of charset to the `Content-Type` response header field.
A charset can be defined with a variable:
```nginx
charset $charset;
```
In such a case, all possible values of a variable need to be present in the
configuration at least once in the form of the [charset_map](#charset-map),
[charset](#id1), or [source_charset](#source-charset) directives. For `utf-8`,
`windows-1251`, and `koi8-r` charsets, it is sufficient to include
the files `conf/koi-win`, `conf/koi-utf`, and `conf/win-utf`
into configuration. For other charsets, simply making a fictitious conversion
table works, for example:
```nginx
charset_map iso-8859-5 _ { }
```
In addition, a charset can be set in the `X-Accel-Charset` response header field. This capability can be disabled using the [proxy_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_proxy.md#proxy-ignore-headers), [fastcgi_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_fastcgi.md#fastcgi-ignore-headers), [uwsgi_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_uwsgi.md#uwsgi-ignore-headers), [scgi_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_scgi.md#scgi-ignore-headers), and [grpc_ignore_headers](https://en.angie.software//angie/docs/configuration/modules/http/http_grpc.md#grpc-ignore-headers) directives.
### charset_map
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `charset_map` charset1 charset2 { ... } |
|------------------------------------------------------------------------------------------|--------------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http |
Describes the conversion table from one charset to another. A reverse conversion table is built using the same data. Character codes are given in hexadecimal. Missing characters in the range 80-FF are replaced with "?". When converting from UTF-8, characters missing in a one-byte charset are replaced with "XXX;".
Example:
```nginx
charset_map koi8-r windows-1251 {
C0 FE ; # small yu
C1 E0 ; # small a
C2 E1 ; # small b
C3 F6 ; # small ts
}
```
When describing a conversion table to UTF-8, codes for the UTF-8 charset should be given in the second column, for example:
```nginx
charset_map koi8-r utf-8 {
C0 D18E ; # small yu
C1 D0B0 ; # small a
C2 D0B1 ; # small b
C3 D186 ; # small ts
}
```
Full conversion tables from `koi8-r` to `windows-1251`, and from
`koi8-r` and `windows-1251` to `utf-8` are provided in the
distribution files `conf/koi-win`, `conf/koi-utf`, and
`conf/win-utf`.
### charset_types
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `charset_types` mime-type ...; |
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
| Default | `charset_types text/html text/xml text/plain text/vnd.wap.wml application/javascript application/rss+xml;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Enables module processing in responses with the specified MIME types in addition to `text/html`. The special value `*` matches any MIME type.
### override_charset
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `override_charset` `on` | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default | `override_charset off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, if in location |
Determines whether a conversion should be performed for responses received from a proxied or a FastCGI/uwsgi/SCGI/gRPC server when the responses already carry a charset in the `Content-Type` response header field. If conversion is enabled, a charset specified in the received response is used as a source charset.
#### NOTE
If a response is received in a subrequest then the conversion from the response charset to the main request charset is always performed, regardless of the override_charset directive setting.
### source_charset
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `source_charset` charset; |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default | — |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location, if in location |
Defines the source charset of a response. If this charset is different from the charset specified in the [charset](#id1) directive, a conversion is performed.
# https://en.angie.software/angie/docs/configuration/modules/http/http_dav.md
# DAV
The module is intended for file management automation via the WebDAV protocol. The module processes HTTP and WebDAV methods PUT, DELETE, MKCOL, COPY, and MOVE.
When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild), the module isn't built
by default; it must be enabled with the [build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure)
`--with-http_dav_module`.
In packages and images from [our repositories](https://en.angie.software//angie/docs/installation/index.md#install-packages), the
module is included in the build.
#### NOTE
WebDAV clients that require additional WebDAV methods to operate will not work with this module.
## Configuration Example
```nginx
location / {
root /data/www;
client_body_temp_path /data/client_temp;
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
dav_access group:rw all:r;
limit_except GET {
allow 192.168.1.0/32;
deny all;
}
}
```
## Directives
### create_full_put_path
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `create_full_put_path` `on` | `off`; |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default | `create_full_put_path off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
The WebDAV specification only allows creating files in already existing directories. This directive allows creating all needed intermediate directories.
### dav_access
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `dav_access` users:permissions ...; |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default | `dav_access user:rw;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Sets access permissions for newly created files and directories, e.g.:
```nginx
dav_access user:rw group:rw all:r;
```
If any group or all access permissions are specified then user permissions may be omitted:
```nginx
dav_access group:rw all:r;
```
### dav_methods
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `dav_methods` `off` | method ...; |
|------------------------------------------------------------------------------------------|-------------------------------------|
| Default | `dav_methods off;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Allows the specified HTTP and WebDAV methods. The parameter `off` denies all methods processed by this module. The following methods are supported: PUT, DELETE, MKCOL, COPY, and MOVE.
A file uploaded with the PUT method is first written to a temporary file, and then the file is renamed. Starting from version 0.8.9, temporary files and the persistent store can be put on different file systems. However, be aware that in this case a file is copied across two file systems instead of the cheap renaming operation. It is thus recommended that for any given `location` both saved files and a directory holding temporary files, set by the [client_body_temp_path](https://en.angie.software//angie/docs/configuration/modules/http/index.md#client-body-temp-path) directive, are put on the same file system.
When creating a file with the PUT method, it is possible to specify the modification date by passing it in the `Date` header field.
### min_delete_depth
| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | `min_delete_depth` number; |
|------------------------------------------------------------------------------------------|------------------------------|
| Default | `min_delete_depth 0;` |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile) | http, server, location |
Allows the DELETE method to remove files provided that the number of elements in a request path is not less than the specified number. For example, the directive
```nginx
min_delete_depth 4;
```
allows removing files on requests
```console
/users/00/00/name
/users/00/00/name/pic.jpg
/users/00/00/page.html
```
and denies the removal of
```console
/users/00/00
```
# https://en.angie.software/angie/docs/configuration/modules/http/http_docker.md
# Docker
#### Versionadded
Added in version 1.10.0.
The module provides dynamic configuration of proxied server groups
in both [HTTP](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-upstream) and [stream](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-upstream)
contexts based on Docker container labels.
For the functionality to work, a shared memory zone must be configured
in the group (see the `zone` description for [http](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#u-zone) and [stream](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-zone)).
#### NOTE
The module supports working with both Docker and its alternatives,
such as Podman, which implement a compatible API.
The recommended Podman version is 4.9.3 or higher.
The module connects to the Docker daemon via API,
the interaction method with which is specified by the [docker_endpoint](#docker-endpoint) directive.
After obtaining a list of running containers,
Angie analyzes them for the presence of suitable [labels](#docker-labels).
The labels identify the target `upstream` group
and determine whether the server address includes a container port.
For each matching group, Angie adds the container address
from the selected Docker network and applies the remaining label parameters
to the corresponding `upstream` block in the Angie configuration.
#### NOTE
The same container can be added to multiple `upstream` groups.
To do this, simply specify multiple sets of labels
with different group names and values for the `port` label.
This is especially useful
if the container runs several different services on different ports —
each service can be associated with its own group.
The module then subscribes to container lifecycle events
and begins updating the proxied server configuration without reloading Angie:
- when starting a container with suitable labels,
its internal IP address is added to the specified group;
- when stopping or removing a container,
it is automatically removed from the group;
- when pausing a container with the **docker pause** command,
the server is marked as `down`,
and with **docker unpause** — as `up`.
## Configuration Example
The module's directives are always located in the `http` context,
but proxied server groups can be defined
in both the `http` context and the `stream` context.
Configuration example for `http`:
```nginx
http {
# Examples of connection options:
# docker_endpoint http://127.0.0.1:2375;
# docker_endpoint https://127.0.0.1:2376;
docker_endpoint unix:/var/run/docker.sock;
# maximum Docker response buffer size (optional)
# docker_max_object_size 128k;
upstream u {
zone z 1m; # shared memory zone is required
}
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://u;
}
}
}
```
Similarly in stream context:
```nginx
http {
# Examples of connection options:
# docker_endpoint http://127.0.0.1:2375;
# docker_endpoint https://127.0.0.1:2376;
docker_endpoint unix:/var/run/docker.sock;
# maximum Docker response buffer size (optional)
# docker_max_object_size 128k;
}
stream {
upstream u {
zone z 1m;
}
server {
listen 12345;
proxy_pass u;
}
}
```
Upon receiving an event for a container,
Angie looks for labels of the form
`angie.http.upstreams..port=` (for HTTP context)
or `angie.stream.upstreams..port=` (for stream context).
When a label is present, the container's address in the selected Docker network
is added to the corresponding proxied server group.
The network is taken from the `angie.(http|stream).upstreams..network`
label, if set for that upstream; otherwise, from the container-wide
`angie.network` label; if there's no label, the first available network is used.
If a container stops or is removed, the server is removed from the group;
if a container is paused, the server is marked as `down`.
Fragment of a `docker-compose.yml` file with labels that Angie recognizes:
```yaml
services:
myapp:
image: myapp:latest
labels:
- "angie.http.upstreams.u.port=8080"
- "angie.network=my_bridge"
- "angie.http.upstreams.u.weight=2"
- "angie.http.upstreams.u.max_conns=50"
- "angie.http.upstreams.u.max_fails=3"
- "angie.http.upstreams.u.fail_timeout=10s"
- "angie.http.upstreams.u.backup=true"
```
## Labels
Labels specify server parameters in the proxied server group
similar to the arguments of the `server` directive:
| Label | Purpose |
|-------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `angie.(http|stream).upstreams..port=` *(required)* | Adds the container to the group named ``. Set the value to the numeric container port that Angie connects to, or to `*` for a [portless](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#s-u-no-port) stream group (PRO). |
| `angie.network=` | Name of the Docker network from which to take the container's IP address. |
| `angie.(http|stream).upstreams..network=` | Name of the Docker network for this proxied upstream; takes precedence over the `angie.network` label. |
| `angie.(http|stream).upstreams..weight=` | Value of the `weight` parameter. |
| `angie.(http|stream).upstreams..max_conns=` | Maximum number of simultaneous connections (`max_conns`). |
| `angie.(http|stream).upstreams..max_fails=` | Threshold for failed attempts (`max_fails`). |
| `angie.(http|stream).upstreams..fail_timeout=` | Interval for counting failed attempts (`fail_timeout`). |
| `angie.(http|stream).upstreams..backup=true|false` | Marks the server as `backup`. |
| `angie.(http|stream).upstreams..sid=` | Sets a custom server identifier (`sid`) for the proxied server. |
| `angie.(http|stream).upstreams..slow_start=