[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-26。"],[[["\u003cp\u003eEnvironments in Apigee hybrid provide isolated sandboxes for running API proxies, allowing for multiple environments within a single organization.\u003c/p\u003e\n"],["\u003cp\u003eDeploying a limited number of proxies to each environment is a best practice in hybrid setups to optimize message processor boot-up time, scaling performance, and minimize the impact of proxy crashes.\u003c/p\u003e\n"],["\u003cp\u003eThe ingress routes proxy requests to the appropriate message processor based on the environment and host alias, ensuring requests are handled correctly.\u003c/p\u003e\n"],["\u003cp\u003eEnvironment groups allow grouping of environments that share hostnames, simplifying routing configuration by only requiring the environment group name and certificates for each virtual host.\u003c/p\u003e\n"],["\u003cp\u003eMessage processor boot up time and scaling performance will be affected by how many proxies are deployed in an environment, with the recommendation of deploying only a limited number.\u003c/p\u003e\n"]]],[],null,["# About environments\n\n| You are currently viewing version 1.6 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\nAn *environment* provides an isolated context or \"sandbox\" for running API proxies.\nIn a single organization, you can create multiple environments.\n\n\nThe following code shows an example override configuration where multiple environments are\ndefined. \n\n```actionscript-3\nnamespace: my-namespace\norg: my-organization\n...\nenvs:\n - name: test\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n\n - name: prod\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n...\n```\n\n\nSuppose a proxy with the base path `/foo1` is deployed to environment\n**test**. You could call the proxy like this: \n\n```\ncurl -k https://api.example.com/foo1\n```\n\n\nWhen this call hits the ingress, the ingress knows to send it to the message processor\nassociated with the `test` environment, which handles the request.\n\n\nSimilarly, if `foo1` is also deployed to the `prod` environment,\nyou could make a proxy\nrequest like this, to the host alias `apiprod.mydomain.net`: \n\n```\ncurl -k https://apiprod.example.com/foo1\n```\n\n\nAnd the call is routed by the ingress to the MP associated with that host.\n| **NOTE** On a request to an API proxy, the ingress compares the `Host` header of the incoming request to the list of host aliases to determine which virtual host handles the request. `curl` commands, browsers, and many other utilities automatically set the `Host` header with the domain of the request. If for any reason your app is not setting the `Host` header automatically, you must set it manually.\n\n\n**Antipattern**: Deploy all of your proxies to one hybrid environment.\n\n\n**Best practice**: Create multiple environments and deploy a limited number of proxies\nto each one.\n\nLimit the number of proxy deployments\n-------------------------------------\n\n\nFor hybrid, the fact that many environments can share the same virtual hosts\nas defined in environment groups means\nthat you must think carefully about how you manage your proxy deployments to any given\nenvironment. In hybrid, the best practice is to create multiple environments and deploy\na limited number of proxies to each one.\n\n\n**How many proxies should you deploy to an environment?** There is not a set answer\nto this question; however, the following table provides general guidance on why it's a\ngood idea to limit the number of proxies deployed to each environment and what you\nneed to think about when managing proxy deployments:\n| **NOTE:** When deciding how many proxies to deploy to an environment, be sure to consider the product configuration limits described in [Limits](/apigee/docs/api-platform/reference/limits#hybrid).\n\nEnvironment groups and virtualhosts\n-----------------------------------\n\n[Environment groups](/apigee/docs/api-platform/fundamentals/environments-overview)\nallow you to group environments together. Environments within each group share\nthe same hostnames. You can group environments by function, by hostname address, by region if you\nare implementing a multi-region hybrid installation, or by any other metric you\nchoose.\n\n\nBecause routing is managed by the combination of environment group hostnames, API proxy base paths,\nand environments, each virtual host only needs to list the name of the environment group and any\nappropriate certs.\n\n\nThe following code shows an example override configuration where multiple virtualhosts are\ndefined. Note that name of the virtualhosts must be the names of the environment groups. \n\n```actionscript-3\ngcp:\n region: us-central1\n projectID: hybrid-example\n\nk8sCluster:\n name: apigee-hybrid\n region: us-central1\n\norg: hybrid-example\n\ninstanceID: \"my_hybrid_example\"\n\nvirtualhosts:\n - name: group-1 # the name of an environment group\n sslCertPath: ./certs/keystore.pem\n sslKeyPath: ./certs/keystore.key\n\nvirtualhosts:\n - name: group-2\n sslCertPath: ./certs/keystore.pem\n sslKeyPath: ./certs/keystore.key\n...\n```\n\nAdditional resources\n--------------------\n\n- [About environments and environment groups](/apigee/docs/api-platform/fundamentals/environments-overview)\n- [Managing environments](/apigee/docs/api-platform/fundamentals/environments-working-with)\n- [Managing environment groups](/apigee/docs/api-platform/fundamentals/environmentgroups-working-with)\n- [Configuration property reference](/apigee/docs/hybrid/v1.6/config-prop-ref#envs)\n- [Configure virtual hosts](/apigee/docs/hybrid/v1.6/base-path-routing)"]]