Django and Elastic Beanstalk URL health checks

前端 未结 2 1734
闹比i
闹比i 2020-12-30 10:50

I have a Django webapp. It runs inside Docker on Elastic Beanstalk.

I\'d like to specify a health check URL for slightly more advanced health checking than \"can the

2条回答
  •  悲哀的现实
    2020-12-30 11:26

    This is what I use, and it works well:

    import socket
    local_ip = str(socket.gethostbyname(socket.gethostname()))
    ALLOWED_HOSTS=[local_ip, '.mydomain.com', 'mydomain.elasticbeanstalk.com' ]
    

    where you replace mydomain and mydomain.elasticbeanstalk.com with your own.

提交回复
热议问题