Reverse Proxying for Services running on Proxmox Hypervisor

Okay after hours of reading I decided to use Pi-Hole for local DNSing. Thought about installing it into the same Dockerstack as my Caddy runs but I can’t deploy because both containers want to use the same containers:

Docker Compose looks like this:

version: '3'

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    environment:
      - WEBSOCKET_ENABLED=true # Enable WebSocket notifications.
      - ADMIN_TOKEN=#aoufhorwpiüjijqjfpomrfjpqiopejomfpojmrfeI
      # - SIGNUPS_ALLOWED=false
      - DOMAIN=https://vaultwarden.mine.duckdns.org
      # - SIGNUPS_ALLOWED=true
      # - SIGNUPS_VERIFY=true
      # - SIGNUPS_DOMAINS_WHITELIST=example.com,example.net,example.org
    volumes:
      - ./vw-data:/data

  caddy:
    image: caddy:2
    container_name: caddy
    restart: always
    ports:
      - 80:80  # Needed for the ACME HTTP-01 challenge.
      - 443:443
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - ./caddy-config:/config
      - ./caddy-data:/data
    environment:
      - DOMAIN=mine.duckdns.org  # Your domain.
      - EMAIL=mail@alexander-bloch.de    # The email address to use for ACME registration.
      - LOG_FILE=/data/access.log

  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer-ce
    restart: always
    ports:
      - 9000:9000
      - 8000:8000
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./portainer_data:/data

  watchtower:
    image: containrrr/watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock


  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
      - "80:80/tcp"
    environment:
      TZ: 'America/Chicago'
      WEBPASSWORD: PASSWORD
    # Volumes store your data between container upgrades
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed
    restart: unless-stopped

Do I need to create a own LXC for the Pi-Hole Server?

You can proxy HTTP traffic (port 80) through Caddy to pihole as another site.

Okay so what I did is, I gave the Pi-Hole Container a own IP Address via macvlan and it’s workin well so far. So I have now set up a local domain for example http://home.assistant and want caddy to proxy this to http://192.168.0.12:8123. Thought it has to be:

# Homeassistant intern
http://home.assistant:80 {
  reverse_proxy 192.168.0.12:8123
}

But it won’t work.

{"level":"error","ts":1677419703.747064,"logger":"http.log.error","msg":"dial tcp 192.168.0.12:8123: connect: connection refused","request":{"remote_ip":"192.168.0.31","remote_port":"62855","proto":"HTTP/1.1","method":"GET","host":"home.assistant","uri":"/","headers":{"Accept-Encoding":["gzip, deflate"],"Connection":["keep-alive"],"Upgrade-Insecure-Requests":["1"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15"],"Accept-Language":["de-DE,de;q=0.9"]}},"duration":0.022644443,"status":502,"err_id":"s484byga0","err_trace":"reverseproxy.statusError (reverseproxy.go:1299)"}

do you need a more verbose log or sth. else from me?

Or should I open a new topic?

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