【发布时间】:2015-04-04 04:53:34
【问题描述】:
我在此代码中使用 Celery 任务生成图像。这是 ajax 视图函数的一部分。
task_result = generate_result_image.apply((answer, combi.id, lang))
if task_result.state == "SUCCESS":
response['ok'] = 'yes'
return HttpResponse(json.dumps(response), content_type='application/json')
这在本地完美运行,但在 prod 服务器中,我收到 502 错误网关。这是浏览器控制台消息:
我做错了什么?这真的很神秘。。
这是uwsgi日志,光标所在的那一行就是我正在做的调用。我似乎,工人在我打电话后就死了......不知道为什么......
【问题讨论】:
-
这可能是关于你的 nginx + uwsgi 配置(如果我没记错的话)。
-
@alecxe 嘿 alex,我需要在 nginx+uwsgi conf 中为 ajax 设置其他东西吗?
-
@alecxe 你是对的,我想,请看我的更新,我发布了来自 uwsgi 日志的截图
-
多么漂亮的一套harakiris。