django+uwsgi+nginx ajax post 504 Gateway Time-out

用django+uwsgi+nginx 后端执行一个函数时间过长,致使前端Failed to load resource: the server responded with a status of 504 (Gateway Time-out)html

排查缘由前端

(1)首先检查django是否没问题python

 直接用python manage.py runserver运行发现没有问题nginx

(2)只用uwsgi运行djangodjango

也没有发现问题后端

(3)应该是nginx的设置问题服务器

             服务器上有两个nginx,一个是nginx作域名转发,另一个链接uwsgi,以前修改映射本地端口的nginx转发的,修改并       没有产生效果。看接口日志也没有发现缘由。因此一直觉得是配置的问题,可是试了好多配置都没有效果。因而去另一个         域名转发nginx看下日志结果发现:函数

应该是读取时间设置太短,致使超时日志

搞了一上午,终于搞定了。server

附录:

  1. uwsgi参数

    http://uwsgi-docs.readthedocs.org/en/latest/Options.html

    http://heipark.iteye.com/blog/1847421

  2. nignx参数

    http://www.ha97.com/5194.html

相关文章
相关标签/搜索