Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 1, Docker Recipe, 502 Bad Gateway #1

Closed
rossm6 opened this issue Aug 11, 2019 · 1 comment
Closed

Chapter 1, Docker Recipe, 502 Bad Gateway #1

rossm6 opened this issue Aug 11, 2019 · 1 comment

Comments

@rossm6
Copy link

rossm6 commented Aug 11, 2019

Hi

I'm new to web development and thought this book looked great to help me with Django. But I'm stuck on the first chapter already and can't see my fault. Please help !

After cloning the repo, I navigate to the root of the chapter_1/myproject_docker. Before running any commands I have created this line in /etc/hosts (on my Ubuntu 18.04 OS)

127.0.0.1 myproject.local media.myproject.local static.myproject.local

And I have made sure the dev script is executable.

I then build the docker image with -

run ./bin/dev build

And finally I run -

MYSQL_USER=myproject_user MYSQL_PASSWORD=pass1234 ./bin/dev up -d

It creates the containers fine. However when i go to "http://myproject.local" in my browser I get "502 Bad Gateway - nginx/1.17.2"

Any ideas ?

@rossm6 rossm6 changed the title Chatper 1, Docker Recipe, 502 Bad Gateway Chapter 1, Docker Recipe, 502 Bad Gateway Aug 11, 2019
@thebpmgroup
Copy link

thebpmgroup commented Nov 16, 2019

I had this. I had missed the step on adding the entry into the hosts file. See page 30. You need entries for myproject.local, media.myproject.local and static.project.local

Also NGINX needs to know where to forward the request on to, and this is done through a virtual port, see page 27.

Also make sure you have set your SITE_HOST environment variable in the bin/dev.sh or bin/dev file (depending on if you used an extension)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants