Disable port:2019 from outside

1. Caddy version (caddy version):

caddy 2.2.1-alpine

2. How I run Caddy:

docker-compose up
# DOCKER COMPOSE FILE
version: '3.3'

services:

  r_master:
    image: python:3.8-slim
    container_name: r_master
    volumes:
      - ./r_master:/r_master
      - ./r_runners:/r_runners
      - ./r_hub:/r_hub
    ports:
      - 8000:8000
    depends_on:
      - u_postgresql
    working_dir: /r_master/backend
    command: >
        bash -c "pip install --upgrade pip
        && pip install -r requirements.txt 
        && python manage.py migrate
        && python manage.py rundomains
        && gunicorn --chdir /r_master/backend core.wsgi:application --name myapp --workers 1 --user root --bind 0.0.0.0:8000"

        
  u_postgresql:
    image: postgres:10-alpine
    restart: always
    container_name: u_postgresql
    volumes:
      - ./u_postgresql:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=USER
      - POSTGRES_DB=DATA
      - POSTGRES_PASSWORD=PASSWORD
    ports:
      - 5432:5432



  u_caddy:
    image: caddy:2.2.1-alpine
    restart: unless-stopped
    container_name: u_caddy
    depends_on:
      - r_master
    ports:
      - 80:80
      - 443:443
      - 2019:2019
    volumes:
      - ./u_caddy/Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config
      - ./r_runners:/r_runners
      - ./r_master:/r_master

volumes:
  caddy_data:
  caddy_config:

a. System environment:

Ubuntu 18.04.5 LTS
Docker Version : 20.10.2

c. Service/unit/compose file:

{
    # debug
    admin 0.0.0.0:2019
}

(redirect) {
        @http {
                protocol http
        }
        redir @http https://{hostport}{uri} 302
}

run.zetasis.ml {
  reverse_proxy @notStatic r_master:8000
  # reverse_proxy @notStatic unix//path/to/sockfile.sock
        #  log {
        #      level DEBUG
        #      output file /path/to/caddy.log
        #      format single_field common_log
        #  }
  @notStatic {
      not {
          path /static*
          path /media*
      }
  }
  root * /r_master/frontend
}

3. The problem I’m having:

hi everyone,
i am using docker and docker compose for caddy. everything works well except one problem.
i can connect from outside to http://xx.xx.xx.xxx:2019/config/ 
i disabled the port 2019 using UFW but still i can connect. what can i do for that.

thank you for your help.
have nice day.

5. What I already tried:

disable the port 2019 using UFW

Please upgrade to v2.3.0!

Then just remove the port mapping?

Ultimately this isn’t a Caddy question but more of a linux networking question.

This topic was automatically closed after 30 days. New replies are no longer allowed.