Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I am following a tutorial on how to dockerize django with postgres, gunicorn and nginx on an ubuntu 20.04 system. (see as reference: https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/ )
Unfortunately while setting up the nginx part of the app I’ve seem to have stumbled accross a problem with setting up the reverse proxy correctly.
When I try to access the django app via <ip-address>:1337 I get ‘The requested resource was not found on this server.’ error.
While I know that this is due to django not being properly served to nginx, but I’m quite new at web deployment and currently at a loss on how to proceed.
The relevant settings:
docker-compose.prod.yml
services:
web:
build:
context: ./app
dockerfile: Dockerfile.prod
command: gunicorn hello_django.wsgi:application --bind 0.0.0.0:8000
expose:
- 8000
env_file:
- ./.env.prod
depends_on:
- db
db:
image: postgres:12.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.prod.db
nginx:
build: ./nginx
ports:
- 1337:80
depends_on:
- web
volumes:
postgres_data:
nginx.conf
upstream hello_django {
server web:8000;
}
server {
listen 80;
location / {
proxy_pass http://hello_django;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
}
nginx Dockerfile
FROM nginx:1.19.0-alpine
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
ALLOWED_HOSTS = ['<ip-address>', 'localhost']
Any help would be really appreciated.
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
032f50ee7f7d489db3b05e204fe139
032f50ee7f7d489db3b05e204fe139
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e
markatango
gouskova