Envie comentários
Como usar um nginx.conf personalizado no GKE
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Aviso : o uso dessa sinalização não é recomendado porque pode corromper vários recursos. Normalmente, o ESP usa a configuração nginx gerada a partir das sinalizações de inicialização. Quando uma configuração nginx personalizada é fornecida com a sinalização `-n`, a configuração nginx gerada não é usada, e o ESP não funciona corretamente.
O método ideal para gerar uma configuração nginx personalizada é o seguinte:
Implantar um contêiner ESP com as sinalizações de inicialização adequadas
Copiar a configuração nginx gerada de /etc/nginx/endpoints/nginx.conf
Aplicar as alterações na cópia do nginx.config gerada
Repita as etapas acima sempre que usar uma nova versão do ESP ou alterar uma sinalização de inicialização.
Se você quiser usar um nginx.conf
personalizado no Google Kubernetes Engine, prepare um estendendo esta amostra nginx.conf . Aqui está um snippet de configuração exigido pelo Cloud Endpoints:
Agora, crie um Configmap do Kubernetes com o nginx.conf
personalizado usando kubectl
:
kubectl create configmap nginx-config --from-file= nginx.conf
Edite o arquivo de configuração do Kubernetes, como esp_echo_custom_config_gke.yaml
e substitua SERVICE_NAME
pelo nome do serviço do Endpoints.
Por fim, inicie o serviço com o arquivo de configuração atualizado do Kubernetes usando kubectl
.
kubectl create -f esp_echo_custom_config_gke.yaml
Envie comentários
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons , e as amostras de código são licenciadas de acordo com a Licença Apache 2.0 . Para mais detalhes, consulte as políticas do site do Google Developers . Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2024-09-25 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Problema na tradução"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Outro"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Fácil de entender"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Meu problema foi resolvido"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Outro"
}]
Quer enviar seu feedback?
{"lastModified": "\u00daltima atualiza\u00e7\u00e3o 2024-09-25 UTC."}
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","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"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2024-09-25 UTC."]]