请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

一会儿出现502,现在又开始出现504.可以访问8000端口,不能直接访问ip地址。

504 Gateway Time-out
nginx/1.20.1
502 Bad Gateway
nginx/1.20.1

spawned uWSGI worker 1 (and the only) (pid: 689, cores: 1)
[pid: 689|app: 0|req: 1/1] 39.72.50.95 () {38 vars in 819 bytes} [Fri Oct 22 15:43:58 2021] GET / => generated 3335 bytes in 27 msecs (HTTP/1.1 200) 3 headers in 110 bytes (1 switches on core 0)
[pid: 689|app: 0|req: 2/2] 39.72.50.95 () {38 vars in 736 bytes} [Fri Oct 22 15:43:59 2021] GET /static/js/carousel.js => generated 77 bytes in 1 msecs (HTTP/1.1 404) 3 headers in 100 bytes (1 switches on core 0)
[pid: 689|app: 0|req: 3/3] 39.72.50.95 () {40 vars in 937 bytes} [Fri Oct 22 15:43:59 2021] GET /media/product_image/2021/10/057333ed3c2f530d3486a6278c6d360.jpg => generated 0 bytes in 1 msecs (HTTP/1.1 304) 2 headers in 77 bytes (0 switches on core 0)
[pid: 689|app: 0|req: 4/4] 39.72.50.95 () {40 vars in 903 bytes} [Fri Oct 22 15:43:59 2021] GET /media/product_image/2021/10/xieliu_VVfdADJ.jpg => generated 0 bytes in 0 msecs (HTTP/1.1 304) 2 headers in 77 bytes (0 switches on core 0)
[pid: 689|app: 0|req: 5/5] 180.163.220.3 () {34 vars in 810 bytes} [Fri Oct 22 15:46:54 2021] GET /news/list => generated 1799 bytes in 6 msecs (HTTP/1.1 200) 3 headers in 110 bytes (1 switches on core 0)
[pid: 689|app: 0|req: 6/6] 180.163.220.67 () {40 vars in 897 bytes} [Fri Oct 22 15:46:59 2021] GET /news/list => generated 1799 bytes in 4 msecs (HTTP/1.1 200) 3 headers in 110 bytes (1 switches on core 0)
[pid: 689|app: 0|req: 7/7] 180.163.220.67 () {38 vars in 838 bytes} [Fri Oct 22 15:47:05 2021] GET /static/css/xinwen.css => generated 77 bytes in 0 msecs (HTTP/1.1 404) 3 headers in 100 bytes (1 switches on core 0)
[pid: 689|app: 0|req: 8/8] 39.72.50.95 () {40 vars in 843 bytes} [Fri Oct 22 15:54:48 2021] GET / => generated 3335 bytes in 4 msecs (HTTP/1.1 200) 3 headers in 110 bytes (1 switches on core 0)
[pid: 689|app: 0|req: 9/9] 39.72.50.95 () {40 vars in 806 bytes} [Fri Oct 22 15:54:48 2021] GET /static/js/carousel.js => generated 77 bytes in 0 msecs (HTTP/1.1 404) 3 headers in 100 bytes (1 switches on core 0)
[pid: 689|app: 0|req: 10/10] 39.72.50.95 () {42 vars in 911 bytes} [Fri Oct 22 15:54:48 2021] GET /media/product_image/2021/10/xieliu_VVfdADJ.jpg => generated 0 bytes in 0 msecs (HTTP/1.1 304) 2 headers in 77 bytes (0 switches on core 0)
[pid: 689|app: 0|req: 11/11] 39.72.50.95 () {42 vars in 945 bytes} [Fri Oct 22 15:54:48 2021] GET /media/product_image/2021/10/057333ed3c2f530d3486a6278c6d360.jpg => generated 0 bytes in 0 msecs (HTTP/1.1 304) 2 headers in 77 bytes (0 switches on core 0)

云服务器80端口也打开了。
允许 自定义 TCP
80/80 IPv4地址段访问

正在回答 回答被采纳积分+3

1回答

bobby 2021-10-23 10:54:59

只要出现504或者502就代表你的nginx配置没有问题不用排查这个,你现在要排查的是502和504的问题,如果出现502达标你的django项目有异常, 如果出现504代表你的django项目端口无法访问 是否没有启动? 通过ssh启动的uwsgi最好是在tmux中启动

0 回复 有任何疑惑可以回复我~
  • 提问者 慕侠3297407 #1
    如果报502的话一般程序哪个模块有问题啊?在本地网站显示正常。
    回复 有任何疑惑可以回复我~ 2021-10-23 17:10:47
  • 提问者 慕侠3297407 #2
    跟服务器性能有没有关系,我买了一核1G的最低配
    回复 有任何疑惑可以回复我~ 2021-10-23 22:40:19
  • bobby 回复 提问者 慕侠3297407 #3
    502的话就是wsgi启动的django有异常
    回复 有任何疑惑可以回复我~ 2021-10-25 19:44:01
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信