[英]ERR_CONNECTION_TIMED_OUT while deploying django using AWS elastic beanstalk(with nginx + gunicorn)
I'm facing ERR_CONNECTION_TIMED_OUT while deploying django using aws elastic beanstalk.我在使用 aws elastic beanstalk 部署 django 时面临 ERR_CONNECTION_TIMED_OUT。
Current status当前状态
However, when I tried to connect instance using the url the elastic beanstalk provide, I've been always seeing ERR_CONNECTION_TIMED_OUT on chrome browser.但是,当我尝试使用弹性 beanstalk 提供的 url 连接实例时,我一直在 chrome 浏览器上看到 ERR_CONNECTION_TIMED_OUT。
Things I've tried.我尝试过的事情。
tail -f /var/log/nginx/*
[ec2-user@ip-172-31-0-29 ~]$ sudo lsof -i -P -n | grep LISTEN
rpcbind 2650 rpc 8u IPv4 16321 0t0 TCP *:111 (LISTEN)
rpcbind 2650 rpc 11u IPv6 16324 0t0 TCP *:111 (LISTEN)
master 3130 root 13u IPv4 18639 0t0 TCP 127.0.0.1:25 (LISTEN)
sshd 3328 root 3u IPv4 20466 0t0 TCP *:22 (LISTEN)
sshd 3328 root 4u IPv6 20475 0t0 TCP *:22 (LISTEN)
ruby 3475 healthd 6u IPv4 22081 0t0 TCP 127.0.0.1:22221 (LISTEN)
nginx 4778 root 6u IPv4 392465 0t0 TCP *:80 (LISTEN)
nginx 4780 nginx 6u IPv4 392465 0t0 TCP *:80 (LISTEN)
gunicorn 4796 webapp 5u IPv4 392820 0t0 TCP 127.0.0.1:8000 (LISTEN)
gunicorn 4806 webapp 5u IPv4 392820 0t0 TCP 127.0.0.1:8000 (LISTEN)
gunicorn 4807 webapp 5u IPv4 392820 0t0 TCP 127.0.0.1:8000 (LISTEN)
gunicorn 4808 webapp 5u IPv4 392820 0t0 TCP 127.0.0.1:8000 (LISTEN)
Could anyone please help me to find out the issue?有人可以帮我找出问题吗? Thanks in advance!
提前致谢!
Based on the comments.根据评论。
The issue turned out to be due to django setting : django.middleware.security.SecurityMiddleware :问题原来是由于django 设置: django.middleware.security.SecurityMiddleware :
The django.middleware.security.SecurityMiddleware provides several security enhancements to the request/response cycle.
django.middleware.security.SecurityMiddleware 为请求/响应周期提供了多项安全增强功能。 Each one can be independently enabled or disabled with a setting.
每个都可以通过设置独立启用或禁用。
Removal of the setting solved the problem.删除设置解决了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.