I'm having problems with nginx reverse proxying as a docker container. My question is about how to correctly proxy pass nginx in a default docker network?

Here's my docker-compose.yml (unnecessary details omitted for brevity)

```
    version: '3'

    networks:
      nginx_default:
          external: true

    services:
      db:
        image: postgres:10.2
        ports:
          - "5432:5432"
        environment: ...

      postgrest:
        image: postgrest/postgrest
        ports:
          - "3000:3000"
        environment: ...

      nginx:
        restart: always
        image: nginx:latest
        ports:
          - "8080:80"
        volumes:
          - ./nginx/nginx.conf:/etc/nginx/sites-enabled/ruler
        command: [nginx-debug, '-g', 'daemon off;']

      webapp:
        build:
          context: "./"
          dockerfile: Dockerfile.dev
        volumes: ...
        ports:
          - "3001:3001"
        environment: ...

```

Here's my nginx.conf

```
    map $http_upgrade $connection_upgrade {
      default upgrade;
      ''      close;
    }

    server {
      listen 80;
      server_name _;

      gzip on;
      gzip_proxied any;
      gzip_types text/plain text/xml text/css application/x-javascript;
      gzip_vary on;
      gzip_disable "MSIE [1-6]\.(?!.*SV1)";

      access_log /var/log/nginx/access.log;
      error_log /var/log/nginx/error.log warn;

      location / {
        try_files $uri @node;
      }

      location /api/ {
        try_files $uri @postgrest;
      }

      location @node {
        proxy_pass http://webapp:3001;
        proxy_redirect off;
        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_cache_bypass $http_upgrade;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_cache_bypass $http_cache_control;
        add_header X-Proxy-Cache $upstream_cache_status;
      }

      location @postgrest {
        proxy_pass http://postgrest:3000;
        proxy_http_version 1.1;

        default_type application/json;

        proxy_set_header  Connection "";
        proxy_hide_header Content-Location;
        add_header Content-Location  /api/$upstream_http_content_location;
      }
    }

```

And my Dockerfile.dev 

```
    FROM node:8.9

    WORKDIR /client

    CMD npm run dev -- -p 3001

```

When I do `$ docker-compose up -d` everything starts without an error. After that I can successfully do `$ curl http://127.0.0.1:3001/` (webapp) and `$ curl http://127.0.0.1:3000` (postgrest). 

But when I try `$ curl http://127.0.0.1:8080/` (nginx should handle here the proxying) I get default nginx welcome page. Also `$ curl http://127.0.0.1:8080/api/` is not hitting the API :/

What may be the cause? Using `$ docker inspect` I see that every container is in the same default network.

Edit: Using `$ docker-compose logs` seems like the default network is not used at all O\_o

```
    docker-compose logs
    WARNING: Some networks were defined but are not used by any service: nginx_default
    Attaching to ruler_webapp_1, ruler_nginx_1
    webapp_1  | 
    webapp_1  | > ruler@ dev /client
    webapp_1  | > next "-p" "3001"
    webapp_1  | 
    webapp_1  | > Using external babel configuration
    webapp_1  | > Location: "/client/.babelrc"
    webapp_1  |  DONE  Compiled successfully in 1741ms09:04:49
    webapp_1  | 

```