Google 會運用 AI 技術將內容翻譯成您偏好的語言,但可能會出錯。
建立自訂 nginx.conf 來支援 CORS
透過集合功能整理內容
您可以依據偏好儲存及分類內容。
如新增 CORS 支援至 ESP 所述,您可以將可擴充服務 Proxy (ESP) 設定為支援 CORS。如果 ESP 選項並未提供應用程式需要的 CORS 支援,您可以將 CORS 選項新增至 ESP 的設定檔 nginx.conf。
將 CORS 選項新增至 nginx.conf
如要新增 CORS 選項,請執行下列操作:
先處理 nginx.conf 檔案且該檔案包含 Cloud Endpoints 需要的設定。您可以從範例nginx.conf開始,或在部署 ESP 後,透過 SSH 連線至 ESP 容器,然後從 /etc/nginx/endpoints/ 目錄複製 nginx.conf 檔案。
將應用程式需要的 CORS 選項新增至 nginx.conf。一開始,您可以使用 NGINX 中的 CORS 範例。
使用 --nginx_config 選項啟動 ESP,且該選項中包含自訂 nginx.conf 檔案的路徑。
後續步驟
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2026-12-04 (世界標準時間)。"],[],[]]