Conforme descrito em Como adicionar suporte a CORS ao ESP, você pode configurar o Extensible Service Proxy (ESP) para dar suporte ao CORS.
Se as opções de ESP não fornecerem o suporte ao CORS exigido pelo seu aplicativo, você poderá adicionar as opções do CORS ao arquivo de configuração do ESP, nginx.conf.
Como adicionar as opções de CORS a nginx.conf
Para adicionar as opções do CORS:
Comece com um arquivo nginx.conf que contenha a configuração exigida pelo Cloud Endpoints. Você pode começar com o exemplo nginx.conf ou, se já implementou o ESP, pode enviar SSH para o contêiner ESP e copiar o arquivo nginx.conf do diretório /etc/nginx/endpoints/.
Adicione as opções de CORS que seu aplicativo requer a nginx.conf. Use o exemplo CORS on NGINX como ponto de partida.
Inicie o ESP com a opção --nginx_config com o caminho para o arquivo nginx.conf personalizado.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-03-25 UTC."],[[["You can configure the Extensible Service Proxy (ESP) to support CORS, as described in the documentation for adding CORS support to ESP."],["If ESP options don't meet your application's CORS needs, you can customize CORS by adding options directly to ESP's `nginx.conf` configuration file."],["To add custom CORS options, begin with a `nginx.conf` file required by Cloud Endpoints, such as the sample one, or by retrieving it from a deployed ESP container."],["After adding your custom CORS settings to `nginx.conf`, start ESP using the `--nginx_config` option, pointing to your modified configuration file."]]],[]]