<!-- review: finished -->

<a id="stream-proxy"></a>

# Proxy

Allows proxying data streams over TCP, UDP, and UNIX domain sockets.

<a id="configuration-example-65"></a>

## Configuration Example

```nginx
server {
    listen 127.0.0.1:12345;
    proxy_pass 127.0.0.1:8080;
}

server {
    listen 12345;
    proxy_connect_timeout 1s;
    proxy_timeout 1m;
    proxy_pass example.com:12345;
}

server {
    listen 53 udp reuseport;
    proxy_timeout 20s;
    proxy_pass dns.example.com:53;
}

server {
    listen [::1]:12345;
    proxy_pass unix:/tmp/stream.socket;
}
```

<a id="directives-74"></a>

## Directives

<a id="index-0"></a>

<a id="s-proxy-bind"></a>

### proxy_bind

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_bind` address [`transparent`] | `off`;   |
|------------------------------------------------------------------------------------------|-------------------------------------------------|
| Default                                                                                  | —                                               |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                                  |

Makes outgoing connections to a proxied server originate from the specified local IP address. Parameter value can contain variables. The special value `off` cancels the effect of the proxy_bind directive inherited from the previous configuration level, which allows the system to auto-assign the local IP address.

The `transparent` parameter allows outgoing connections to a proxied server originate from a non-local IP address, for example, from a real IP address of a client:

```nginx
proxy_bind $remote_addr transparent;
```

For this parameter to work,
Angie worker processes usually need to run
with [superuser](https://en.angie.software//angie/docs/configuration/modules/core.md#user) privileges.
On Linux, this is not required:
if the `transparent` parameter is specified,
worker processes inherit the CAP_NET_RAW capability from the master process.

#### NOTE
The kernel routing table should also be configured
to intercept network traffic from the proxied server.

<a id="index-1"></a>

<a id="s-proxy-buffer-size"></a>

### proxy_buffer_size

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_buffer_size` size;   |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default                                                                                  | `proxy_buffer_size 16k;`    |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server              |

Sets the size of the buffer used for reading data from the proxied server. Also sets the size of the buffer used for reading data from the client.

<a id="index-2"></a>

<a id="s-proxy-connect-timeout"></a>

### proxy_connect_timeout

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_connect_timeout` time;   |
|------------------------------------------------------------------------------------------|---------------------------------|
| Default                                                                                  | `proxy_connect_timeout 60s;`    |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                  |

Defines a timeout for establishing a connection with a proxied server.

<a id="index-3"></a>

<a id="s-proxy-connection-drop"></a>

### proxy_connection_drop

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_connection_drop` time | `on` | `off`;   |
|------------------------------------------------------------------------------------------|------------------------------------------------|
| Default                                                                                  | `proxy_connection_drop off;`                   |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                                 |

Enables termination of all sessions to the proxied server after it has been
removed from the group or marked as permanently unavailable by a [reresolve](https://en.angie.software//angie/docs/configuration/modules/http/http_upstream.md#reresolve) process or the [API command](https://en.angie.software//angie/docs/configuration/modules/http/http_api.md#api-config-methods)
`DELETE`.

A session is terminated when the next read or write event is processed for
either the client or the proxied server.

Setting time enables a session termination [timeout](https://en.angie.software//angie/docs/configuration/configfile.md#syntax);
with `on` set, sessions are dropped immediately.

<a id="index-4"></a>

<a id="s-proxy-download-rate"></a>

### proxy_download_rate

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_download_rate` rate;   |
|------------------------------------------------------------------------------------------|-------------------------------|
| Default                                                                                  | `proxy_download_rate 0;`      |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                |

Limits the speed of reading the data from the proxied server. The `rate` is specified in bytes per second.

| `0`   | disables rate limiting   |
|-------|--------------------------|

#### NOTE
The limit is set per a connection, so if Angie simultaneously opens two connections to the proxied server, 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;
}

proxy_download_rate $rate;
```

<a id="index-5"></a>

<a id="s-proxy-half-close"></a>

### proxy_half_close

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_half_close` `on` | `off`;   |
|------------------------------------------------------------------------------------------|------------------------------------|
| Default                                                                                  | `proxy_half_close off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                     |

Enables or disables closing each direction of a TCP connection independently ("TCP half-close"). If enabled, proxying over TCP will be kept until both sides close the connection.

<a id="index-6"></a>

<a id="s-proxy-next-upstream"></a>

### proxy_next_upstream

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_next_upstream` `on` | `off`;   |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default                                                                                  | `proxy_next_upstream on;`             |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                        |

When a connection to the proxied server cannot be established, determines whether a client connection will be passed to the next server in the [upstream pool](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#stream-upstream).

Passing a connection to the next server can be limited by the [number of tries](#s-proxy-next-upstream-tries) and by [time](#s-proxy-next-upstream-timeout).

<a id="index-7"></a>

<a id="s-proxy-next-upstream-timeout"></a>

### proxy_next_upstream_timeout

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_next_upstream_timeout` time;   |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default                                                                                  | `proxy_next_upstream_timeout 0;`      |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                        |

Limits the time allowed to pass a connection to the [next](#s-proxy-next-upstream) server.

| `0`   | turns off this limitation   |
|-------|-----------------------------|

<a id="index-8"></a>

<a id="s-proxy-next-upstream-tries"></a>

### proxy_next_upstream_tries

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_next_upstream_tries` number;   |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default                                                                                  | `proxy_next_upstream_tries 0;`        |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                        |

Limits the number of possible tries for passing a connection to the [next](#s-proxy-next-upstream) server.

| `0`   | turns off this limitation   |
|-------|-----------------------------|

<a id="index-9"></a>

<a id="s-proxy-pass"></a>

### proxy_pass

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_pass` address;   |
|------------------------------------------------------------------------------------------|-------------------------|
| Default                                                                                  | —                       |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | server                  |

Sets the address of a proxied server. The `address` can be specified as a domain name or IP address, and a port:

```nginx
proxy_pass localhost:12345;
```

or as a UNIX domain socket path:

```nginx
proxy_pass unix:/tmp/stream.socket;
```

If a domain name resolves to several addresses, all of them will be used in a round-robin fashion. In addition, an address can be specified as a [server group](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#stream-upstream).

The address can also be specified using variables:

```nginx
proxy_pass $upstream;
```

In this case, the server name is searched among the described [server groups](https://en.angie.software//angie/docs/configuration/modules/stream/stream_upstream.md#stream-upstream) and, if not found, is determined using a [resolver](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#s-resolver).

<a id="index-10"></a>

<a id="s-proxy-protocol"></a>

### proxy_protocol

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_protocol` `on` | `off`;   |
|------------------------------------------------------------------------------------------|----------------------------------|
| Default                                                                                  | `proxy_protocol off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                   |

Enables the [PROXY protocol](http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) for connections to a proxied server.

<a id="index-11"></a>

<a id="s-proxy-protocol-version"></a>

### proxy_protocol_version

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_protocol_version` `1` | `2`;   |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default                                                                                  | `proxy_protocol_version 1;`           |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                        |

Sets the PROXY protocol version used for connections to a proxied server. The setting is effective when [proxy_protocol](#s-proxy-protocol) is enabled. Version 2 allows sending TLVs configured by the [proxy_protocol_tlv](#s-proxy-protocol-tlv) directive.

<a id="index-12"></a>

<a id="s-proxy-protocol-tlv"></a>

### proxy_protocol_tlv

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_protocol_tlv` name value;   |
|------------------------------------------------------------------------------------------|------------------------------------|
| Default                                                                                  | —                                  |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                     |

Adds a TLV to the PROXY protocol v2 header sent to a proxied server. The value can contain variables. The name can be a TLV type name or its numeric value; in the latter case, the value is specified in hexadecimal and must start with 0x. For SSL TLVs, use the `ssl_` prefix; the special `ssl_verify` name sets the verify field of the SSL TLV. The directive is used only with [proxy_protocol_version](#s-proxy-protocol-version) set to `2`.

<a id="index-13"></a>

<a id="s-proxy-requests"></a>

### proxy_requests

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_requests` number;   |
|------------------------------------------------------------------------------------------|----------------------------|
| Default                                                                                  | `proxy_requests 0;`        |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server             |

Sets the number of client datagrams at which binding between a client and existing UDP stream session is dropped. After receiving the specified number of datagrams, next datagram from the same client starts a new session. The session terminates when all client datagrams are transmitted to a proxied server and the expected [number of responses](#s-proxy-responses) is received, or when it reaches a [timeout](#s-proxy-timeout).

<a id="index-14"></a>

<a id="s-proxy-responses"></a>

### proxy_responses

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_responses` number;   |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default                                                                                  | —                           |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server              |

Sets the number of datagrams expected from the proxied server in response to a client datagram if the [UDP](https://en.angie.software//angie/docs/configuration/modules/stream/index.md#stream-protocol) protocol is used. The number serves as a hint for session termination. By default, the number of datagrams is not limited.

If zero value is specified, no response is expected. However, if a response is received and the session is still not finished, the response will be handled.

<a id="index-15"></a>

<a id="s-proxy-socket-keepalive"></a>

### proxy_socket_keepalive

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_socket_keepalive` `on` | `off`;   |
|------------------------------------------------------------------------------------------|------------------------------------------|
| Default                                                                                  | `proxy_socket_keepalive off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                           |

Configures the "TCP keepalive" behavior for outgoing connections to a proxied server.

| `off`   | By default, the operating system's settings are in effect for the socket.   |
|---------|-----------------------------------------------------------------------------|
| `on`    | The SO_KEEPALIVE socket option is turned on for the socket.                 |

<a id="index-16"></a>

<a id="s-proxy-ssl"></a>

### proxy_ssl

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl` `on` | `off`;   |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default                                                                                  | `proxy_ssl off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server              |

Enables the SSL/TLS protocol for connections to a proxied server.

<a id="index-17"></a>

<a id="s-proxy-ssl-certificate"></a>

### proxy_ssl_certificate

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_certificate` file [file];   |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default                                                                                  | —                                      |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                         |

Specifies a file with the certificate in the PEM format used for authentication to a proxied server. Variables can be used in the file name.

When [proxy_ssl_ntls](#s-proxy-ssl-ntls) is enabled, the directive takes two arguments instead of one:

```nginx
server {
    proxy_ssl_ntls  on;

    proxy_ssl_certificate      sign.crt enc.crt;
    proxy_ssl_certificate_key  sign.key enc.key;

    proxy_ssl_ciphers "ECC-SM2-WITH-SM4-SM3:ECDHE-SM2-WITH-SM4-SM3:RSA";

    proxy_pass backend:12345;
}
```

<a id="index-18"></a>

<a id="s-proxy-ssl-certificate-key"></a>

### proxy_ssl_certificate_key

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_certificate_key` file [file];   |
|------------------------------------------------------------------------------------------|--------------------------------------------|
| Default                                                                                  | —                                          |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                             |

The value `store:scheme:id` can be specified instead of the `file`, which is used to load a secret key with a specified id and OpenSSL provider registered URI scheme, such as [pkcs11](https://datatracker.ietf.org/doc/html/rfc7512).

Specifies a file with the secret key in the PEM format used for authentication to a proxied server. Variables can be used in the file name.

When [proxy_ssl_ntls](#s-proxy-ssl-ntls) is enabled, the directive accepts two arguments instead of one:

```nginx
server {
    proxy_ssl_ntls  on;

    proxy_ssl_certificate      sign.crt enc.crt;
    proxy_ssl_certificate_key  sign.key enc.key;

    proxy_ssl_ciphers "ECC-SM2-WITH-SM4-SM3:ECDHE-SM2-WITH-SM4-SM3:RSA";

    proxy_pass backend:12345;
}
```

<a id="index-19"></a>

<a id="s-proxy-ssl-ciphers"></a>

### proxy_ssl_ciphers

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_ciphers` ciphers;   |
|------------------------------------------------------------------------------------------|--------------------------------|
| Default                                                                                  | `proxy_ssl_ciphers DEFAULT;`   |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                 |

Specifies the enabled ciphers for requests to a proxied server. The ciphers are specified in the format understood by the OpenSSL library.

The list of ciphers depends on the version of OpenSSL installed.
The full list can be viewed using the `openssl ciphers` command.

#### WARNING
The `proxy_ssl_ciphers` directive does *not* configure ciphers for TLS 1.3 when
using OpenSSL. To configure TLS 1.3 ciphers with OpenSSL, use the
[proxy_ssl_conf_command](#s-proxy-ssl-conf-command) directive, which was added for advanced
SSL configuration.

- In LibreSSL, TLS 1.3 ciphers *can* be configured using
  `proxy_ssl_ciphers`.
- In BoringSSL, TLS 1.3 ciphers cannot be configured.

<a id="index-20"></a>

<a id="s-proxy-ssl-conf-command"></a>

### proxy_ssl_conf_command

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_conf_command` name value;   |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default                                                                                  | —                                      |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                         |

Sets arbitrary OpenSSL configuration [commands](https://docs.openssl.org/master/man3/SSL_CONF_cmd/) when establishing a connection with the proxied server.

#### NOTE
The directive is supported when using OpenSSL 1.0.2 or higher.
To configure TLS 1.3 ciphers with OpenSSL, use the `ciphersuites` command.

Several proxy_ssl_conf_command directives can be specified on the same level. These directives are inherited from the previous configuration level if and only if there are no proxy_ssl_conf_command directives defined on the current level.

#### WARNING
Note that configuring OpenSSL directly might result in unexpected behavior.

<a id="index-21"></a>

<a id="s-proxy-ssl-crl"></a>

### proxy_ssl_crl

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_crl` file;   |
|------------------------------------------------------------------------------------------|-------------------------|
| Default                                                                                  | —                       |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server          |

Specifies a file with revoked certificates (CRL) in the PEM format used to [verify](#s-proxy-ssl-verify) the certificate of the proxied server.

<a id="index-22"></a>

<a id="s-proxy-ssl-name"></a>

### proxy_ssl_name

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_name` name;                   |
|------------------------------------------------------------------------------------------|------------------------------------------|
| Default                                                                                  | `proxy_ssl_name` host from `proxy_pass`; |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                           |

Allows overriding the server name used to [verify](#s-proxy-ssl-verify) the certificate of the proxied server and to be [passed through SNI](#s-proxy-ssl-server-name) when establishing a connection with the proxied server. The server name can also be specified using variables.

By default, the host name from the address specified by the [proxy_pass](#s-proxy-pass) directive is used.

<a id="index-23"></a>

<a id="s-proxy-ssl-ntls"></a>

### proxy_ssl_ntls

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_ntls` `on` | `off`;   |
|------------------------------------------------------------------------------------------|----------------------------------|
| Default                                                                                  | `proxy_ssl_ntls off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                   |

Enables client-side support for NTLS when using the [TongSuo](https://github.com/Tongsuo-Project/Tongsuo) TLS library.

```nginx
server {
    proxy_ssl_ntls  on;

    proxy_ssl_certificate      sign.crt enc.crt;
    proxy_ssl_certificate_key  sign.key enc.key;

    proxy_ssl_ciphers "ECC-SM2-WITH-SM4-SM3:ECDHE-SM2-WITH-SM4-SM3:RSA";

    proxy_pass backend:12345;
}
```

#### NOTE
Angie must be built using the `--with-ntls` configuration parameter, with the corresponding SSL library with NTLS support

```default
./configure --with-openssl=../Tongsuo-8.3.0 \
            --with-openssl-opt=enable-ntls  \
            --with-ntls
```

<a id="index-24"></a>

<a id="s-proxy-ssl-password-file"></a>

### proxy_ssl_password_file

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_password_file` file;   |
|------------------------------------------------------------------------------------------|-----------------------------------|
| Default                                                                                  | —                                 |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                    |

Specifies a file with passphrases for [secret keys](#s-proxy-ssl-certificate-key) where each passphrase is specified on a separate line. Passphrases are tried in turn when loading the key.

<a id="index-25"></a>

<a id="s-proxy-ssl-protocols"></a>

### proxy_ssl_protocols

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_protocols` [`SSLv2`] [`SSLv3`] [`TLSv1`] [`TLSv1.1`] [`TLSv1.2`] [`TLSv1.3`];   |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| Default                                                                                  | `proxy_ssl_protocols TLSv1.2 TLSv1.3;`                                                     |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                                                                             |

#### Versionchanged
Changed in version 1.2.0: The `TLSv1.3` parameter was added to the default set.

Enables the specified protocols for requests to a proxied server.

<a id="index-26"></a>

<a id="s-proxy-ssl-server-name"></a>

### proxy_ssl_server_name

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_server_name` `on` | `off`;   |
|------------------------------------------------------------------------------------------|-----------------------------------------|
| Default                                                                                  | `proxy_ssl_server_name off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                          |

Enables or disables passing the server name
specified by the [proxy_ssl_name](#s-proxy-ssl-name) directive
through the
[Server Name Indication](http://en.wikipedia.org/wiki/Server_Name_Indication)
TLS extension
(SNI,
[RFC 6066](https://datatracker.ietf.org/doc/html/rfc6066.html))
when establishing a connection with the proxied server.

<a id="index-27"></a>

<a id="s-proxy-ssl-session-reuse"></a>

### proxy_ssl_session_reuse

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_session_reuse` `on` | `off`;   |
|------------------------------------------------------------------------------------------|-------------------------------------------|
| Default                                                                                  | `proxy_ssl_session_reuse on;`             |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                            |

Determines whether SSL sessions can be reused when working with the proxied server. If the errors "SSL3_GET_FINISHED:digest check failed" appear in the logs, try disabling session reuse.

<a id="index-28"></a>

<a id="s-proxy-ssl-trusted-certificate"></a>

### proxy_ssl_trusted_certificate

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_trusted_certificate` file;   |
|------------------------------------------------------------------------------------------|-----------------------------------------|
| Default                                                                                  | —                                       |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                          |

Specifies a file with trusted CA certificates in the PEM format used to [verify](#s-proxy-ssl-verify) the certificate of the proxied server.

<a id="index-29"></a>

<a id="s-proxy-ssl-verify"></a>

### proxy_ssl_verify

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_verify` `on` | `off`;   |
|------------------------------------------------------------------------------------------|------------------------------------|
| Default                                                                                  | `proxy_ssl_verify off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                     |

Enables or disables verification of the proxied server certificate.

<a id="index-30"></a>

<a id="s-proxy-ssl-verify-depth"></a>

### proxy_ssl_verify_depth

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_ssl_verify_depth` number;   |
|------------------------------------------------------------------------------------------|------------------------------------|
| Default                                                                                  | `proxy_ssl_verify_depth 1;`        |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server                     |

Sets the verification depth in the proxied server certificates chain.

<a id="index-31"></a>

<a id="s-proxy-timeout"></a>

### proxy_timeout

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_timeout` time;   |
|------------------------------------------------------------------------------------------|-------------------------|
| Default                                                                                  | `proxy_timeout 10m;`    |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server          |

Sets a timeout between two successive read or write operations on client or proxied server connections. If no data is transmitted within this time, the connection is closed.

<a id="index-32"></a>

<a id="s-proxy-upload-rate"></a>

### proxy_upload_rate

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `proxy_upload_rate` rate;   |
|------------------------------------------------------------------------------------------|-----------------------------|
| Default                                                                                  | `proxy_upload_rate 0;`      |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | stream, server              |

Limits the speed of reading the data from the client. The rate is specified in bytes per second.

| `0`   | disables rate limiting   |
|-------|--------------------------|

#### NOTE
The limit is set per connection, so if the client simultaneously opens two connections, the overall rate will be twice as much as the specified limit.

The parameter value can contain variables. This may be useful in cases where the rate should be limited depending on a certain condition:

```nginx
map $slow $rate {
    1     4k;
    2     8k;
}

proxy_upload_rate $rate;
```
