第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

HTTPConnectionPool(host='xxxx', port=y):讀取超時(shí)。

HTTPConnectionPool(host='xxxx', port=y):讀取超時(shí)。

藍(lán)山帝景 2022-07-05 17:16:00
在我的 python 腳本中,有多個(gè) API 調(diào)用,并且 API 在同一個(gè)應(yīng)用程序中!我正在使用 django 框架!通過(guò) python3 manage.py runserver 它工作正常!但是在帶有 nginx 服務(wù)器、主管、gunicorn 的 centos7 虛擬機(jī)中,調(diào)用第三個(gè) API 后它無(wú)法正常工作!出現(xiàn)了這個(gè)錯(cuò)誤:The complete exception is provided below:<class 'requests.exceptions.ReadTimeout'>HTTPConnectionPool(host='x.x.x.x', port=y): Read timed out. (read timeout=None)在 nginx 錯(cuò)誤日志中只有這個(gè)錯(cuò)誤:[error] 12020#12020: *133 upstream prematurely closed connection while reading response header from upstream, client:需要一些幫助
查看完整描述

1 回答

?
子衿沉夜

TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超3個(gè)贊

終于我找到了解決辦法!


其實(shí)是因?yàn)間unicom和nginx的超時(shí)。


我的腳本需要 30 多秒,所以請(qǐng)更新我的 gunicorn 配置文件!


這是配置:


[program:project]

command = gunicorn -c /opt/project/gunicorn_config.py project.wsgi -t 300

directory = project directory

user = user

nginx配置也需要添加這個(gè)代理設(shè)置:


location / {

    proxy_pass http://127.0.0.1:8001;

    proxy_set_header X-Forwarded-Host $server_name;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_set_header X-Forwarded-Proto $scheme;

    add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';

    proxy_read_timeout 300s;

    proxy_connect_timeout 300s;

}

謝謝!如果有人遇到同樣的問(wèn)題,希望這會(huì)有所幫助!


查看完整回答
反對(duì) 回復(fù) 2022-07-05
  • 1 回答
  • 0 關(guān)注
  • 477 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)