Si vous souhaitez utiliser un fichier nginx.conf personnalisé sur Google Kubernetes Engine, préparez-en un en étendant cet exemple de fichier nginx.conf.
Voici un extrait de la configuration requise par Cloud Endpoints :
Modifiez le fichier de configuration Kubernetes, par exemple esp_echo_custom_config_gke.yaml, et remplacez SERVICE_NAME par le nom du service Endpoints.
Enfin, démarrez le service avec le fichier de configuration Kubernetes mis à jour à l'aide de kubectl.
kubectl create -f esp_echo_custom_config_gke.yaml
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/03/25 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/03/25 (UTC)."],[[["Using the `-n` 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."],["To customize the nginx configuration, deploy an ESP container, copy the generated `nginx.conf` from `/etc/nginx/endpoints/`, and make your changes to the copied file."],["When using a custom `nginx.conf` 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."],["The nginx configuration must include specific directives like `endpoints { on; }` and after ESP version 1.7.0, the `server_config` field should be set to `/etc/nginx/server_config.pb.txt` for proper functionality."],["After creating a custom `nginx.conf`, 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."]]],[]]