Configure virtual hosts

You are currently viewing version 1.14 of the Apigee hybrid documentation. For more information, seeSupported versions.

This topic discusses thevirtualhosts configuration property. Virtual hosts allow Apigee hybrid to handle API requests to hostaliases associated with an environment group. For more information, seeRouting and base paths in theAbout environments and environment groups topic.

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

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 applyvirtualhosts to the cluster, seeApplying virtualhosts changes. For information about configuring TLS, seeConfiguring TLS and mTLS on the Istio ingress.

Adding multiple virtual hosts

Thevirtualhosts[] property is an array, and therefore you can create more than one.
...virtualhosts:  - name: my-env-group-1    sslCertPath: ./certs/fullchain1.pem    sslKeyPath: ./certs/privkey1.key  - name: my-env-group-2    sslCertPath: ./certs/fullchain2.pem    sslKeyPath: ./certs/privkey2.key...
Tip: For security purposes, it is best practice to have a separate TLS cert/key pair for each virtual host. If you are using a Subject Alternative Name (SAN ) certificate, this TLS cert/key pair should be used on one virtual host that is shared across the domain.

For information about configuring TLS, seeConfiguring TLS and mTLS on the Istio ingress.

Applyingvirtualhosts changes

If you only add or change thevirtualhosts property, apply the changes with theapigee-virtualhost chart and the name of the environment group to which you are applying the changes:

helm upgrade$ENV_GROUP apigee-virtualhost/ \  --namespaceapigee \  --atomic \  --set envgroup=$ENV_GROUP \  -fOVERRIDES_FILE.yaml
Note: If you see an error sayingError: UPGRADE FAILED: "ENV_GROUP" has no deployed releases, replaceupgrade withinstall and try the command again.

If, for example, you changevirtualhosts andenv, then you must apply the change withhelm upgrade without using theENV_GROUP apigee-virtualhost/flag to update the cluster. For example:

Runhelm upgrade for each environment you want to update.

helm upgrade$ENV_NAME apigee-env/ \  --namespaceapigee \  --atomic \  --set env=$ENV_NAME \  -fOVERRIDES_FILE.yaml
Note: If you see an error sayingError: UPGRADE FAILED: "ENV_NAME" has no deployed releases, replaceupgrade withinstall and try the command again.

TLS keys and certificates

Thevirtualhost 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:

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.