<!-- review: finished -->

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

# Pass

Allows passing the accepted connection directly to any configured listening
socket in [HTTP](https://en.angie.software//angie/docs/configuration/modules/index.md#modules-http), [Stream](https://en.angie.software//angie/docs/configuration/modules/index.md#modules-stream), or
[Mail](https://en.angie.software//angie/docs/configuration/modules/index.md#modules-mail) modules.

The module enables selective SSL termination based on SNI.

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

## Configuration Example

After the `stream` module handles the SSL/TLS termination,
it forwards the connection to the `http` module:

```nginx
stream {

    server {

        listen 8000 default_server;
        ssl_preread on;
        # ...
    }

    server {

        listen 8000;
        server_name foo.example.com;
        pass 127.0.0.1:8001; # to HTTP
    }

    server {

        listen 8000;
        server_name bar.example.com;
        # ...
    }
}

http {

    server {

        listen 8001 ssl;
        # ...

        location / {

            root html;
        }
    }
}
```

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

## Directives

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

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

### pass

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

This directive sets the server address to which the client connection should be
passed. The address can be given as an IP address and port:

```nginx
pass 127.0.0.1:12345;
```

Or as a path to a UNIX domain socket:

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

Also, the address can be set with variables:

```nginx
pass $upstream;
```
