Reverse proxy to Docker

Lets assume that the Django server runs on port 8000 of a docker container service named app

The server config to pass server name to django docker container is,

    server {
        listen 80;

        location / {
            try_files $uri $uri/ @python_django;

        location @python_django {
            proxy_pass http://app:8000;
            proxy_pass_request_headers on;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_redirect off;

Now you can access the django server with URL