ESP がサービス構成 ID を使用するように設定します。このオプションの設定に必要な情報については、サービス名と構成 ID を取得するをご覧ください。--rollout_strategy=fixed を指定する場合、または --rollout_strategy オプションを含めない場合は、--version オプションを含めて構成 ID を指定する必要があります。この場合、新しい Endpoints 構成をデプロイするたびに、新しい構成 ID を使用して ESP を再起動する必要があります。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-12-21 UTC。"],[[["\u003cp\u003eThe Extensible Service Proxy (ESP) is an NGINX-based proxy used with Cloud Endpoints for API management, configured via startup options when the ESP Docker container is launched.\u003c/p\u003e\n"],["\u003cp\u003eESP startup options can be specified in the \u003ccode\u003edocker run\u003c/code\u003e command or in the \u003ccode\u003eargs\u003c/code\u003e field of a Kubernetes deployment manifest file.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--rollout_strategy=managed\u003c/code\u003e option is recommended for ESP to automatically use the latest deployed service configuration, updating within five minutes of a new deployment.\u003c/p\u003e\n"],["\u003cp\u003eCORS support in ESP can be enabled using the \u003ccode\u003e--cors_preset\u003c/code\u003e option, with choices of \u003ccode\u003ebasic\u003c/code\u003e or \u003ccode\u003ecors_with_regex\u003c/code\u003e, and additional options like \u003ccode\u003e--cors_allow_origin\u003c/code\u003e to customize \u003ccode\u003eAccess-Control-Allow-Origin\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize ESP's behavior by specifying a custom NGINX configuration file and providing service account credentials when running ESP outside of Google Cloud.\u003c/p\u003e\n"]]],[],null,["# Extensible Service Proxy startup options\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/specify-proxy-startup-options \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nThe [Extensible Service Proxy\n(ESP)](/endpoints/docs/openapi/glossary#extensible_service_proxy) is an\n[NGINX-based](/endpoints/docs/openapi/glossary#nginx) proxy that enables\nCloud Endpoints to provide API management features. You configure\nESP by specifying options when you start the ESP\nDocker container. When the ESP container starts, it runs a script\ncalled `start_esp`, which writes the NGINX configuration file by using the\noptions that you specified and launches ESP.\n\nYou specify ESP startup options in the `docker run` command, for example: \n\n```\nsudo docker run \\\n --detach \\\n DOCKER_ARGUMENTS \\\n gcr.io/endpoints-release/endpoints-runtime:1 \\\n --service=SERVICE_NAME \\\n --rollout_strategy=managed \\\n --backend=YOUR_API_CONTAINER_NAME:8080\n```\n\nIf you are deploying ESP to Kubernetes, you specify the startup\noptions in your deployment manifest file in the `args` field, for example: \n\n```\ncontainers:\n- name: esp\n image: gcr.io/endpoints-release/endpoints-runtime:1\n args: [\n \"--http_port=8081\",\n \"--backend=127.0.0.1:8080\",\n \"--service=SERVICE_NAME\",\n \"--rollout_strategy=managed\"\n ]\n```\n\nThe following table describes ESP's startup options.\n\n^1^ These ports are optional and must be distinct from each other.\nIf you don't specify any port option, ESP accepts HTTP/1.x\nconnections on port `8080`.\nFor HTTPS connections, ESP expects the TLS secrets to be\nlocated at `/etc/nginx/ssl/nginx.crt` and `/etc/nginx/ssl/nginx.key`.\n\nSample command-line invocations\n-------------------------------\n\nThe following examples show how to use some of the command-line arguments:\n\nTo start ESP to handle requests coming in at HTTP/1.x port `80`\nand HTTPS port `443` and send the requests to your API backend at\n`127.0.0.1:8000`: \n\n```\nsudo docker run \\\n --detach \\\n DOCKER_ARGUMENTS \\\n gcr.io/endpoints-release/endpoints-runtime:1\n --service=echo-api.endpoints.example-project-12345.cloud.goog \\\n --rollout_strategy=managed \\\n --http_port=80 \\\n --ssl_port=443 \\\n --backend=127.0.0.1:8000\n```\n\nTo start ESP with a custom NGINX configuration by using the\nservice account credentials file to fetch the service config and connect to the\nservice control: \n\n```\nsudo docker run \\\n --detach \\\n --volume=$HOME/Downloads:/esp \\\n DOCKER_ARGUMENTS \\\n gcr.io/endpoints-release/endpoints-runtime:1 \\\n --service=echo-api.endpoints.example-project-12345.cloud.goog \\\n --rollout_strategy=managed \\\n --service_account_key=/esp/serviceaccount.json \\\n --nginx_config=/esp/nginx.conf\n \n```\n\nNote that you must use the Docker flags `--volume` or `--mount` to mount the\nJSON file containing the private key for the service account and the custom\nNGINX config file as volumes inside ESP's Docker container. The\npreceding example maps the `$HOME/Downloads` directory on the local computer to\nthe `esp` directory in the container. When you save the private key file for the\nservice account, it is typically downloaded to the `Downloads` directory. You\ncan copy the private key file to another directory if you want to. See\n[Manage data in Docker](https://docs.docker.com/storage/)\nfor more information.\n\nAdding CORS support to ESP\n--------------------------\n\nPlease refer to [Support CORS](/endpoints/docs/openapi/support-cors) for a description of available CORS support options. This section describes using ESP startup flags to support CORS.\n\nTo enable CORS support in ESP, include the `--cors_preset` option\nand set it to either `basic` or `cors_with_regex`. When you include\n`--cors_preset=basic` or `--cors_preset=cors_with_regex`, ESP:\n\n- Assumes all location paths have the same CORS policy.\n- Responds to both [simple requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests) and [preflight](https://developer.mozilla.org/docs/Web/HTTP/CORS#Preflighted_requests) `HTTP OPTIONS` requests.\n- Caches the result of the preflight `OPTIONS` request for up to 20 days (1728000 seconds).\n- Sets the response headers to the following values:\n\n ```scdoc\n Access-Control-Allow-Origin: *\n Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS\n Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization\n Access-Control-Expose-Headers: Content-Length,Content-Range\n ```\n\nTo override the default value of\n[`Access-Control-Allow-Origin`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Access-Control-Allow-Origin),\nspecify one of the following options:\n\nAfter setting `--cors_preset=basic` or `--cors_preset=cors_with_regex` to enable\nCORS, you can override the default values of the other response headers by\nspecifying one or more of the following options:\n\nIf the ESP CORS startup options don't suit the needs of your\napplication, you can create a custom `nginx.conf` file with the CORS support\nthat your application requires. For more information, see\n[Creating a custom `nginx.conf` to support CORS](/endpoints/docs/openapi/custom-cors-nginx).\n\nWhat's next\n-----------\n\nLearn about:\n\n- [Deploying ESP and your API backend to Google Cloud](/endpoints/docs/openapi/deploy-api-backend)\n- [Running ESP locally or on another platform](/endpoints/docs/openapi/running-esp-localdev)\n- The [`start_esp`](https://github.com/cloudendpoints/esp/tree/master/start_esp) script on GitHub"]]