Django Elasticbeanstalk应用程序在自动缩放期间返回404

时间:2018-03-13 23:24:24

标签: django apache elastic-beanstalk

我有一个在弹性beanstalk上运行的django应用程序。从命令行部署时,应用程序部署并正常工作。 但是,在自动缩放期间,创建的新实例的运行状况检查始终从access_logs返回404。

  

" GET / health / HTTP / 1.1" 404 221" - " " ELB-HealthChecker / 1.0"

有趣的是,应用程序最终会在大约20分钟后加载。 请参阅下面的wsgi.conf文件。 有什么我做错了吗?

LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /opt/python/run/baselinenv
WSGISocketPrefix run/wsgi
WSGIRestrictEmbedded On
<VirtualHost *:80>

Alias /static/ /opt/python/current/app/staticfiles/
<Directory /opt/python/current/app/staticfiles/>
Require all granted
</Directory>


WSGIScriptAlias / /opt/python/current/app/myapp/wsgi.py


<Directory /opt/python/current/app/>
Require all granted
</Directory>

Header always set Access-Control-Allow-Methods "POST,GET,OPTIONS,PUT,DELETE, PATCH"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, Accept, origin, authorization, accept, client-security-token, Authorization"
WSGIDaemonProcess wsgi processes=3 threads=20 display-name=%{GROUP} \
  python-path=/opt/python/current/app:/opt/python/run/venv/lib/python2.7/site-packages:/opt/python/run/venv/lib64/python2.7/site-packages user=wsgi group=wsgi \
  home=/opt/python/current/app
WSGIProcessGroup wsgi
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule !/api/v1.0/church/health/ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
</VirtualHost>

WSGIPassAuthorization On

1 个答案:

答案 0 :(得分:0)

我只检查生产的健康状况,我使用的网址是/login

在EBT信息中心查看configuration>health

我怀疑您的网址/health不是由django管理的。