2

I am trying to deploy a django application to AWS ElasticBeanstalk. I am working on a Linux machine. It all goes well but when deployment is done I get "502 Gateway Error". From a deep search I found that people with the similar problem created Procfile to the root directory of the project and added the following to that: "web: gunicorn--bind :8000 --workers 3 --threads 2 applicationName.wsgi:application". I tried that but then I get "ServiceError - Failed to deploy application." Any clues on that?

asked Aug 6, 2021 at 15:45
2
  • 1
    Have you fixed the issue? If not the first thing you should do is check the logs. Commented Aug 12, 2021 at 11:10
  • I was able to solve that, check the answer. But there wasn't any useful info related to that. Commented Aug 12, 2021 at 12:16

1 Answer 1

1

Pretty weird but it was showing that Gateway Error only because I had left

ALLOWED_HOSTS=['*']

After changing that to

ALLOWED_HOSTS=['app_url'] 
# where app_url is the url provided by eb when it is deployed firstly 
answered Aug 12, 2021 at 12:14
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.