[英]flask with uwsgi nginx gateway timeout
我已經設置了一個燒瓶應用程序來使用uwsgi和nginx
我在互聯網上使用了教程,但存在以下問題
我在controller.py文件上具有以下功能
api_module = Blueprint('cassandra_api', __name__, url_prefix="/api")
@api_module.route('/', methods=['GET', 'POST'])
def home():
return "c"
嘗試時以上效果很好
myip/api/
但是以下內容根本不起作用
@api_module.route("/fault_prone_snippets/", methods=['GET'])
def get_fault_prone_snippets():
#code to connect with cassandra db and retrieve get parameters
當我訪問
myip/api/faut_prone_snippets/
使用或不使用get參數,均不執行任何代碼,沒有看到錯誤消息,並且等待一分鍾后,我收到網關超時消息。 問題是,當我從本地主機運行燒瓶時,它運行良好。 在我的開發環境中嘗試從python控制台使用cassandra驅動程序也可行,並且沒有錯誤連接。 當它在本地但不在生產環境中工作時,如何調試這種設置?
當您在nginx后面運行時,可能是在nginx.conf
的http
部分中設置keep_alive
超時會有所幫助。 和/或location
部分中的proxy_send_timeout
和proxy_read_timeout
參數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.