If you want to use a custom nginx.conf on Google Kubernetes Engine, prepare one by
extending this
sample nginx.conf.
Here is a snippet of the configuration required by Cloud Endpoints:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-21 UTC."],[[["\u003cp\u003eUsing the \u003ccode\u003e-n\u003c/code\u003e flag to provide a custom nginx configuration is generally not recommended, as it can lead to feature breakage; instead, the preferred method is to modify a copy of the automatically generated configuration.\u003c/p\u003e\n"],["\u003cp\u003eTo customize the nginx configuration, deploy an ESP container, copy the generated \u003ccode\u003enginx.conf\u003c/code\u003e from \u003ccode\u003e/etc/nginx/endpoints/\u003c/code\u003e, and make your changes to the copied file.\u003c/p\u003e\n"],["\u003cp\u003eWhen using a custom \u003ccode\u003enginx.conf\u003c/code\u003e on Google Kubernetes Engine, you should use the provided sample configuration as a base and ensure that it contains the required settings for Cloud Endpoints.\u003c/p\u003e\n"],["\u003cp\u003eThe nginx configuration must include specific directives like \u003ccode\u003eendpoints { on; }\u003c/code\u003e and after ESP version 1.7.0, the \u003ccode\u003eserver_config\u003c/code\u003e field should be set to \u003ccode\u003e/etc/nginx/server_config.pb.txt\u003c/code\u003e for proper functionality.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating a custom \u003ccode\u003enginx.conf\u003c/code\u003e, it needs to be deployed into Kubernetes via a ConfigMap and referenced within the Kubernetes configuration file, ensuring that the ESP container's arguments point to the custom configuration location.\u003c/p\u003e\n"]]],[],null,[]]