
在我將 Node js 應用程式的連接埠從 3000 更改為 3001 後,少數頁面中的某些資源未完全加載,最終導致 504 網關逾時 (nginx/1.10.3(Ubuntu) )。經過進一步調查 nginx 日誌檔:
2019/09/19 19:54:33 [錯誤] 14156#14156: *690847 從上游讀取回應標頭時上游逾時(110:連線逾時),客戶端:128.227.1.21,伺服器:lims.rgportal.com ,請求:“GET /projects/59e133a53e785ff00550cee7/tempPlatePools HTTP/1.1”,上游:“http://127.0.0.1:3001/projects/59e133a53e785ff00550cee7/tempPlatePools”,主機:“lims.rgportal.com”,引薦來源:“https://lims.rgportal.com/」
請幫忙 !
答案1
我終於弄清楚了,我必須在 nginx.conf 檔案中添加 4 行額外的行來設定連接、發送、讀取逾時,然後重新啟動 nginx 服務。
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
然後重新載入 nginx 服務: nginx -s reload