Wenn Sie eine benutzerdefinierte nginx.conf auf Google Kubernetes Engine verwenden möchten, erweitern Sie diese Beispiel-nginx.conf, um die Datei vorzubereiten. Dies ist ein Snippet aus der Konfiguration, die für Cloud Endpoints benötigt wird:
Bearbeiten Sie die Kubernetes-Konfigurationsdatei, z. B. esp_echo_custom_config_gke.yaml und ersetzen Sie SERVICE_NAME mit dem Namen Ihres Endpoints-Dienstes.
[[["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-18 (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,[]]