In diesem Thema wird das Konfigurationsattribut virtualhosts erläutert.
Mit virtuellen Hosts kann Apigee Hybrid API-Anfragen an Hostaliasse einer Umgebungsgruppe verarbeiten. Weitere Informationen finden Sie unter Routing und Basispfade im Thema Umgebungen und Umgebungsgruppen.
Wenn Sie beispielsweise virtualhosts und env ändern, müssen Sie die Änderung ohne Verwendung von ‑‑settings anwenden, um den Cluster zu aktualisieren. Beispiel:
Oder aktualisieren Sie die Komponente für alle Umgebungen:
apigeectl apply -f overrides-file.yaml --all-envs
TLS-Schlüssel und -Zertifikate
Für das Attribut virtualhost sind ein TLS-Schlüssel und ein Zertifikat erforderlich.
Schlüssel und Zertifikat werden zur sicheren Kommunikation mit dem Ingress-Gateway verwendet und muss mit den Hostaliassen in der angegebenen Umgebungsgruppe kompatibel sein.
Sie entscheiden selbst, wie Sie geeignete TLS-Zertifikat-/Schlüsselpaare für Ihre Hybridkonfiguration generieren. Die folgenden Themen werden nur als Beispiele bereitgestellt. Sie dienen hauptsächlich zum Ausprobieren oder Testen einer neuen Hybridinstallation, wenn es nicht möglich ist, TLS-Anmeldedaten abzurufen.
Unter TLS-Anmeldedaten abrufen finden Sie eine Reihe von Beispielschritten für die Erstellung eines autorisierten TLS-Zertifikat-/Schlüsselpaars.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-28 (UTC)."],[[["\u003cp\u003eThis documentation is for Apigee hybrid version 1.3, which is end-of-life, and users should upgrade to a newer version.\u003c/p\u003e\n"],["\u003cp\u003eVirtual hosts in Apigee hybrid allow the system to manage API requests to host aliases associated with an environment group.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003evirtualhosts[]\u003c/code\u003e property can include multiple virtual host configurations, enabling the setup of several environment groups.\u003c/p\u003e\n"],["\u003cp\u003eChanges to the \u003ccode\u003evirtualhosts\u003c/code\u003e property can be applied independently using the \u003ccode\u003e‑‑settings virtualhosts\u003c/code\u003e flag, or along with other configurations by applying changes without this flag.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring the \u003ccode\u003evirtualhost\u003c/code\u003e requires a TLS key and certificate, which are crucial for secure communication with the ingress gateway, and instructions for both authorized and self-signed key/cert pairs are provided for testing purposes.\u003c/p\u003e\n"]]],[],null,["# Configure virtual hosts\n\n| 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](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\n\nThis topic discusses the [virtualhosts](/apigee/docs/hybrid/v1.3/config-prop-ref#virtualhosts) configuration property.\nVirtual hosts allow Apigee hybrid to handle\nAPI requests to hostaliases associated with an environment group. For more information, see\n[Routing and base\npaths](/apigee/docs/api-platform/fundamentals/environments-overview#routing) in the [About\nenvironments and environment groups](/apigee/docs/api-platform/fundamentals/environments-overview) topic. \n\n```\n...\nvirtualhosts:\n - name: my-env-group\n sslCertPath: ./certs/fullchain.pem\n sslKeyPath: ./certs/privkey.pem\n...\n```\n\n\nWhen an API proxy call comes, it is routed to the host alias(es) of the environment group\nwhere the API proxy is deployed.\n\n\nFor instructions on how to apply `virtualhosts` to the cluster, see\n[Applying virtualhosts changes](#applying). For information about configuring\nTLS, see [Configuring TLS and mTLS on the Istio ingress](/apigee/docs/hybrid/v1.3/ingress-tls).\n\nAdding multiple virtual hosts\n-----------------------------\n\n\nThe `virtualhosts[]` property is an array, and therefore you can create more than\none. \n\n```\n...\nvirtualhosts:\n - name: my-env-group-1\n sslCertPath: ./certs/fullchain.pem\n sslKeyPath: ./certs/privkey.pem\n\n - name: my-env-group-2\n sslCertPath: ./certs/fullchain.pem\n sslKeyPath: ./certs/privkey.pem\n...\n```\n\n\nFor information about configuring\nTLS, see [Configuring TLS and mTLS on the Istio ingress](/apigee/docs/hybrid/v1.3/ingress-tls).\n\nApplying `virtualhosts` changes\n-------------------------------\n\n\nIf you only add or change the `virtualhosts`\nproperty, and nothing else, then you can apply those changes with the `‑‑settings` flag: \n\n```\napigeectl apply -f overrides-file.yaml ‑‑settings virtualhosts\n```\n\nIf, for example, you change `virtualhosts` and `env`, then you must\napply the change without using `‑‑settings`, like this, to update the cluster. For\nexample: \n\n```\napigeectl apply -f overrides-file.yaml --env my-environment\n```\n\n\nor, to update the component for all environments: \n\n```\napigeectl apply -f overrides-file.yaml --all-envs\n```\n\nTLS keys and certificates\n-------------------------\n\nThe `virtualhost` property requires a TLS key and certificate.\nThe key/cert are used to provide secure communication with the ingress gateway and\nmust be compatible with the host aliases used in the specified environment group.\n\n\nIt is up to you how you generate proper TLS certificate/key pairs for your hybrid\nconfiguration. The following topics are provided as samples only, intended primarily\nfor trying out or testing a new hybrid installation if it isn't feasible to obtain\nTLS credentials in another way:\n\n- See [Obtain TLS credentials](/apigee/docs/hybrid/v1.3/lets-encrypt) for a set of sample steps for creating an authorized TLS certificate/key pair.\n- You can use a self-signed certificate/key pair(s) for testing purposes only. See [Generate self-signed TLS credentials](/apigee/docs/hybrid/v1.3/environment-self-signed-tls)."]]