boringproxy-server docker behind caddy docker does not work with/without ssl

I am running a docker host with a public IP.
I am using caddy proxy to route traffic to the correct internal destination (other docker containers).
Port 80 and 433 were bind to caddy container. Caddy is already doing the ssl cert business.

Caddy is forwarding requests for boringproxy domain to ports 8080 or 8433 of boringproxy container host - depends on http or https requests.
I am running the latest version of boringproxy docker image: version: ‘3.7’ (prebuild.yml here on github).

Docker configuration:

cat docker-compose.yml 
version: '3.7'
services:
  boringproxy:
    container_name: boringproxy-server
    restart: unless-stopped
    ports:
      - "8080:80"
      - "8443:443"
    volumes:
      - storage:/storage/
      - ssh://.ssh
      - /etc/ssl/certs/:/etc/ssl/certs/:ro
    command: ["server", "-admin-domain", "test.domain.com", "-acme-email", "me@domain.com", "-accept-ca-terms", "-cert-dir", "/storage/certmagic", "-print-login"]
    environment:
      USER: "root"

volumes:
  storage:
  ssh:

From docker logs:

2022/12/01 11:16:32 Starting up
WARNING: Failed to access my-public-ip:80 from the internet
WARNING: Failed to access my-public-ip:443 from the internet
2022/12/01 11:16:34 Automatic agreement to CA terms with email (me@domain.com)
2022/12/01 11:16:41 test.domain.com: obtaining certificate: [test.domain.com] Obtain: [test.domain.com] solving challenges: test.domain.com: no solvers available for remaining challenges (configured=[http-01 tls-alpn-01] offered=[http-01 dns-01 tls-alpn-01] remaining=[dns-01]) (order=https://acme-v02.api.letsencrypt.org/acme/order/849363237/149281510017) (ca=https://acme-v02.api.letsencrypt.org/directory)

In general I do not need ssl for boringproxy at all - is it possible to disable it?
But what is the problem above? Is letsencrypt trying to connect to ports 80/433 of the public ip (no domain)?

I have now made it work behind Caddy.
Caddy is forwarding the :443 traffic to port 8081 (not 80 nor 443!) of boringproxy server (docker).
The docker container is listening to port :8081 and 8082.
boringproxy is logging

WARNING: LetsEncrypt only supports HTTP/HTTPS ports 80/443. You are using 8081/8082. Disabling automatic certificate management

but you can ignore it - just an info.

Now I can access the generated token url:

2022/12/03 10:00:19 Admin login link: https://test.domain.com/login?access_token=eAsnylshnTc6urJ7bHBYczn9u466ZIyo
1 Like

Hey Pellen,

Did you have any issues with ssh while tunneling? Mine is running behind nginx. Able to access the dashboard and connect client but ssh is not working

I am working with docker containers. SSH on docker host is working normal.
Terminal/logs for single container is managed by docker itself.