curl: (7) failed to connect to localhost port 4444: connection refused code example

Example: cURL error 7: Failed to connect to localhost port 80: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost/oauth/token

#Nginx Service
  nginx:
    image: nginx:alpine
    container_name: nginx
    restart: unless-stopped
    tty: true
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ../:/var/www
      - ./nginx/sites/:/etc/nginx/conf.d/
      - ./nginx/log/:/var/log/nginx/
    depends_on:
      - php-fpm
      - mysql
    networks:
      app-network:
        aliases:
          - api.local

Tags:

Misc Example