> [!CAUTION]
> You are currently viewing version 1.3 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions).

<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.3 (unsupported)</button>

- Supported versions:
- [v1.17 (latest)](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/base-path-routing.md.txt)
- [v1.16](https://docs.cloud.google.com/apigee/docs/hybrid/v1.16/base-path-routing.md.txt)
- [v1.15](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/base-path-routing.md.txt)
- [v1.14](https://docs.cloud.google.com/apigee/docs/hybrid/v1.14/base-path-routing.md.txt)
- [List of supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions)
- Unsupported versions:
- [v1.13](https://docs.cloud.google.com/apigee/docs/hybrid/v1.13/base-path-routing.md.txt)
- [v1.12](https://docs.cloud.google.com/apigee/docs/hybrid/v1.12/base-path-routing.md.txt)
- [v1.11](https://docs.cloud.google.com/apigee/docs/hybrid/v1.11/base-path-routing.md.txt)
- [v1.10](https://docs.cloud.google.com/apigee/docs/hybrid/v1.10/base-path-routing.md.txt)
- [v1.9](https://docs.cloud.google.com/apigee/docs/hybrid/v1.9/base-path-routing.md.txt)
- [v1.8](https://docs.cloud.google.com/apigee/docs/hybrid/v1.8/base-path-routing.md.txt)
- [v1.7](https://docs.cloud.google.com/apigee/docs/hybrid/v1.7/base-path-routing.md.txt)
- [v1.6](https://docs.cloud.google.com/apigee/docs/hybrid/v1.6/base-path-routing.md.txt)
- [v1.5](https://docs.cloud.google.com/apigee/docs/hybrid/v1.5/base-path-routing.md.txt)
- [v1.4](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/base-path-routing.md.txt)
- [v1.3](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/base-path-routing.md.txt)
- [v1.2](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/base-path-routing.md.txt)
- [v1.1](https://docs.cloud.google.com/apigee/docs/hybrid/v1.1/base-path-routing.md.txt)


This topic discusses the [virtualhosts](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/config-prop-ref.md.txt#virtualhosts) configuration property.
Virtual hosts allow Apigee hybrid to handle
API requests to hostaliases associated with an environment group. For more information, see
[Routing and base
paths](https://docs.cloud.google.com/apigee/docs/api-platform/fundamentals/environments-overview#routing) in the [About
environments and environment groups](https://docs.cloud.google.com/apigee/docs/api-platform/fundamentals/environments-overview) topic.

```
...
virtualhosts:
  - name: my-env-group
    sslCertPath: ./certs/fullchain.pem
    sslKeyPath: ./certs/privkey.pem
...
```


When an API proxy call comes, it is routed to the host alias(es) of the environment group
where the API proxy is deployed.


For instructions on how to apply `virtualhosts` to the cluster, see
[Applying virtualhosts changes](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/base-path-routing.md.txt#applying). For information about configuring
TLS, see [Configuring TLS and mTLS on the Istio ingress](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/ingress-tls.md.txt).

## Adding multiple virtual hosts


The `virtualhosts[]` property is an array, and therefore you can create more than
one.

```
...
virtualhosts:
  - name: my-env-group-1
    sslCertPath: ./certs/fullchain.pem
    sslKeyPath: ./certs/privkey.pem

  - name: my-env-group-2
    sslCertPath: ./certs/fullchain.pem
    sslKeyPath: ./certs/privkey.pem
...
```


For information about configuring
TLS, see [Configuring TLS and mTLS on the Istio ingress](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/ingress-tls.md.txt).

## Applying `virtualhosts` changes


If you only add or change the `virtualhosts`
property, and nothing else, then you can apply those changes with the `‑‑settings` flag:

```
apigeectl apply -f overrides-file.yaml ‑‑settings virtualhosts
```

If, for example, you change `virtualhosts` and `env`, then you must
apply the change without using `‑‑settings`, like this, to update the cluster. For
example:

```
apigeectl apply -f overrides-file.yaml --env my-environment
```


or, to update the component for all environments:

```
apigeectl apply -f overrides-file.yaml --all-envs
```

## TLS keys and certificates

The `virtualhost` property requires a TLS key and certificate.
The key/cert are used to provide secure communication with the ingress gateway and
must be compatible with the host aliases used in the specified environment group.


It is up to you how you generate proper TLS certificate/key pairs for your hybrid
configuration. The following topics are provided as samples only, intended primarily
for trying out or testing a new hybrid installation if it isn't feasible to obtain
TLS credentials in another way:

- See [Obtain TLS credentials](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/lets-encrypt.md.txt) for a set of sample steps for creating an authorized TLS certificate/key pair.
- You can use a self-signed certificate/key pair(s) for testing purposes only. See [Generate self-signed TLS credentials](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/environment-self-signed-tls.md.txt).