数字海洋:一键Django不会路由我的域,坏网关

2024-05-15 15:44:03 发布

您现在位置:Python中文网/ 问答频道 /正文

使用ubuntu16、nginx和gunicorn的一键式django不会路由我的域名。当我在地址栏中输入IP地址时,它可以工作,但是当我使用域时,我得到502 Bad Gateway nginx/1.10.3 (Ubuntu)。查看nginx错误日志,我看到:

2017/10/16 19:05:18 [error] 23017#23017: *80 upstream prematurely closed connection while reading response header from upstream, client:修订server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/"

我遵循以下步骤: https://www.digitalocean.com/community/tutorials/how-to-point-to-digitalocean-nameservers-from-common-domain-registrars#registrar-godaddy

在这里: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-host-name-with-digitalocean

但我一定做错了什么。有人知道怎么解决这个问题吗。我是一个全新的人,Django,而且是真正的web开发人员


Tags: todjangofromhttpscommunitycomwwwnginx
2条回答

更新NS服务器最多需要48小时。如果您在48小时前已经更新,请清除浏览器缓存,然后再次访问您的域。通常24小时后,您可以通过浏览器访问您的域。其次,检查对/etc/nginx/sites-available的访问

nginx配置中的上游错误,请参阅nginx日志:http://unix:/....?它应该是http://...或{}-这取决于Django设置的配置方式。在

{{ngi5}并修复cd4{ngi5}的位置。在

相关问题 更多 >