I've some problems connecting to services on my raspberry pi. I desire the following: 1x Raspberry Pi running multiple services (like openhab, mosquitto, nagios, etc.). Each of these services is running in a separate docker container. To bring everything together the plan is to use an nginx reverse proxy together with avahi to provide these service in the local network. So avahi exposes the different subdomains (like openhab.raspberrypi.local, ...) in the local network.
So far so good, the actual state is. All Containers running smoothly, avahi exposes the necessary subdomains to the network, the subdomains are recorded by the potential clients, but if I want to connect to these services nothing responds, no trace route works and the (sub)domains not even seem to exist. I don't know how to debug this.
I've created a minimum example to getting around this, listed below. If i run this on a fresh installed raspberry I expect that I'm able to connect to a webpage 'example.pink-core.local' from the local network.
On my Mac the service is correctly discovered:
But if i want to connect to it i got:
If I expose the port from the example page directly to another port it can be reached, so the container is up and running.
Can anyone help me getting the right direction ?
Example: The avahi section points to a fork from https://github.com/gvuyk/rpi-avahi
version: '3'
services:
nginx:
image: alexanderkrause/rpi-nginx-proxy
restart: always
container_name: nginx-proxy
labels:
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
volumes:
- nginx_certs:/etc/nginx/certs:ro
- nginx_vhosts:/etc/nginx/vhosts.d
- nginx_html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
ports:
- "80:80"
- "443:443"
avahi:
build: avahi
restart: always
container_name: avahi
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
example:
image: hypriot/rpi-busybox-httpd
restart: always
container_name: example
depends_on:
- nginx
environment:
VIRTUAL_HOST: "example.pink-core"
AVAHISERVICES: '[{"name": "example.pink-core","type": "_http._tcp","port": 80}]'
ports:
- "8080:80" #<-- For debugging, direct connection with ip:8080 works
volumes:
nginx_certs:
nginx_vhosts:
nginx_html: