![](/img/trans.png)
[英]How to setup gunicorn with nginx while using aws elastic beanstalk for a django app
[英]ERR_CONNECTION_TIMED_OUT while deploying django using AWS elastic beanstalk(with nginx + gunicorn)
我在使用 aws elastic beanstalk 部署 django 时面临 ERR_CONNECTION_TIMED_OUT。
当前状态
但是,当我尝试使用弹性 beanstalk 提供的 url 连接实例时,我一直在 chrome 浏览器上看到 ERR_CONNECTION_TIMED_OUT。
我尝试过的事情。
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)
有人可以帮我找出问题吗? 提前致谢!
根据评论。
问题原来是由于django 设置: django.middleware.security.SecurityMiddleware :
django.middleware.security.SecurityMiddleware 为请求/响应周期提供了多项安全增强功能。 每个都可以通过设置独立启用或禁用。
删除设置解决了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.