nginx 502 Bad Gateway django
时间: 2023-08-25 12:15:51 浏览: 163
nginx 502 Bad Gateway 错误解决办法
5星 · 资源好评率100%
根据引用内容来看,502 Bad Gateway错误是由于Nginx配置错误导致的。在Nginx的配置文件中,有一处配置出现了问题。具体是在Nginx的配置文件中的location部分,指定了uwsgi的地址为127.0.0.1:8888,而实际上这个地址无法连接到uwsgi服务。另外,经过排查发现,Nginx容器无法连接到Tomcat容器,这是由于它们都是在Docker容器中运行,所以需要将连接地址修改为宿主机的IP地址。在修改后重新测试,问题得到了成功解决。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Nginx+uWSGI+Django出现502和504错误的一种情况和解决办法](https://blog.csdn.net/keanuhrb/article/details/106729456)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [docker容器中 nginx 502 Bad Gateway](https://blog.csdn.net/weixin_38227192/article/details/117780507)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文