Skip to main content

Docke 502 Bad Gateway nginx (Mac)

I'm trying to work out whats causing a 502. When I run docker-compose up, it shows 502 Bad Gateway. Why is that?

in the docker logs write: 2022/01/03 18:35:13 [error] 115#115: *7 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.18.0.5, server: _, request: "GET /typo3/install.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "retro.vm52.iveins.de"

docker-compose.yaml

version: '3.5'
volumes:
  global-db:
services:
  global-nginx-proxy:
    image: jwilder/nginx-proxy
    restart: ${RESTART:-unless-stopped}
    ports:
      - "${HTTP_PORT:-80}:80"
      - "${HTTPS_PORT:-443}:443"
    environment:
      - HSTS=off
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./.docker/config/global-nginx-proxy/additional_nginx.conf:/etc/nginx/conf.d/additional_nginx.conf
      - ./.docker/data/global-nginx-proxy/certs:/etc/nginx/certs:ro
      - ./.docker/data/global-nginx-proxy/dhparam:/etc/nginx/dhparam
    labels:
      - com.github.kanti.local_https.nginx_proxy=true

  global-db:
    image: mysql:5.7
    restart: ${RESTART:-unless-stopped}
    ports:
      - "${DB_PORT:-3306}:3306"
    volumes:
      - global-db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-allowed-packet=16MB --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

  global-db-v8:
    image: mysql:8.0
    restart: ${RESTART:-unless-stopped}
    ports:
      - "${DB_V8_PORT:-3308}:3306"
    volumes:
      - ./.docker/data/global-db-v8:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-allowed-packet=16MB --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

  global-mail:
    image: mailhog/mailhog
    restart: ${RESTART:-unless-stopped}
    ports:
      - "${SMTP_PORT:-1025}:1025"
    environment:
      - VIRTUAL_HOST=mail.${TLD_DOMAIN:?needed}
      - VIRTUAL_PORT=8025

  global-portainer:
    image: portainer/portainer
    restart: ${RESTART:-unless-stopped}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./.docker/data/global-portainer:/data
    environment:
      - VIRTUAL_HOST=portainer.${TLD_DOMAIN:?needed}
      - VIRTUAL_PORT=80
    command: --no-auth

  global-letsencrypt:
    image: kanti/local-https
    restart: ${RESTART:-unless-stopped}
    depends_on:
      - global-nginx-proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./.docker/data/global-letsencrypt:/etc/letsencrypt
      - ./.docker/data/global-nginx-proxy/certs:/etc/nginx/certs
    environment:
      - DNS_CLOUDFLARE_EMAIL=${DNS_CLOUDFLARE_EMAIL:?must be set}
      - DNS_CLOUDFLARE_API_KEY=${DNS_CLOUDFLARE_API_KEY:?must be set}
      - HTTPS_MAIN_DOMAIN=${HTTPS_MAIN_DOMAIN:?must be set}
      - SLACK_TOKEN=${SLACK_TOKEN:-}

  global-xhgui:
    image: edyan/xhgui
    restart: ${RESTART:-unless-stopped}
    environment:
      - VIRTUAL_HOST=xhgui.${TLD_DOMAIN:?needed}
    volumes:
    - ./.docker/data/global-xhgui:/data/db
    networks:
      - default

networks:
  default:
    external:
      name: global

docker-compose.yaml

version: '2'
services:
  #######################################
  # PHP application Docker container
  #######################################
  app:
    build:
      context: .
      dockerfile: Dockerfile.development
    links:
    - mail
    ports:
    - "8000:8080"
    - "8443:443"
    - "10022:22"
    volumes:
    - ./app/:/app/
    - ./:/docker/
    # cap and privileged needed for slowlog
    cap_add:
    - SYS_PTRACE
    privileged: true
    env_file:
    - etc/environment.yml
    - etc/environment.development.yml
    - .env
    environment:
    - VIRTUAL_HOST=retro.vm52.iveins.de
    - VIRTUAL_PORT=80
    - POSTFIX_RELAYHOST=[mail]:1025
  mail:
    image: mailhog/mailhog
    #  ports:
    #    - 8025:8025
    environment:
    - VIRTUAL_HOST=mail.retro.vm52.iveins.de
    - VIRTUAL_PORT=8025

volumes:
  mysql:
  postgres:
  solr:
  elasticsearch:
  redis:
  phpmyadmin:

networks:
  default:
    external:
      name: global

dockerfile

FROM webdevops/php-nginx-dev:7.4

ENV PROVISION_CONTEXT "development"

# Deploy scripts/configurations
COPY etc/             /opt/docker/etc/

RUN ln -sf /opt/docker/etc/cron/crontab /etc/cron.d/docker-boilerplate \
    && chmod 0644 /opt/docker/etc/cron/crontab \
    && echo >> /opt/docker/etc/cron/crontab \
    && ln -sf /opt/docker/etc/php/development.ini /opt/docker/etc/php/php.ini

# Configure volume/workdir
WORKDIR /app/

Please can someone help me shed some light on this. I'm not sure what I can do to test that app and i am not very familiar with dinghy



source https://stackoverflow.com/questions/70570274/docke-502-bad-gateway-nginx-mac

Comments

Popular posts from this blog

Prop `className` did not match in next js app

I have written a sample code ( Github Link here ). this is a simple next js app, but giving me error when I refresh the page. This seems to be the common problem and I tried the fix provided in the internet but does not seem to fix my issue. The error is Warning: Prop className did not match. Server: "MuiBox-root MuiBox-root-1" Client: "MuiBox-root MuiBox-root-2". Did changes for _document.js, modified _app.js as mentioned in official website and solutions in stackoverflow. but nothing seems to work. Could someone take a look and help me whats wrong with the code? Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW

How to show number of registered users in Laravel based on usertype?

i'm trying to display data from the database in the admin dashboard i used this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count(); echo $users; ?> and i have successfully get the correct data from the database but what if i want to display a specific data for example in this user table there is "usertype" that specify if the user is normal user or admin i want to user the same code above but to display a specific usertype i tried this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count()->WHERE usertype =admin; echo $users; ?> but it didn't work, what am i doing wrong? source https://stackoverflow.com/questions/68199726/how-to-show-number-of-registered-users-in-laravel-based-on-usertype

Why is my reports service not connecting?

I am trying to pull some data from a Postgres database using Node.js and node-postures but I can't figure out why my service isn't connecting. my routes/index.js file: const express = require('express'); const router = express.Router(); const ordersCountController = require('../controllers/ordersCountController'); const ordersController = require('../controllers/ordersController'); const weeklyReportsController = require('../controllers/weeklyReportsController'); router.get('/orders_count', ordersCountController); router.get('/orders', ordersController); router.get('/weekly_reports', weeklyReportsController); module.exports = router; My controllers/weeklyReportsController.js file: const weeklyReportsService = require('../services/weeklyReportsService'); const weeklyReportsController = async (req, res) => { try { const data = await weeklyReportsService; res.json({data}) console