I’m trying to set up local DNS using Pi-hole.
I have successfully set up Pi-hole and added a local DNS record local.com
, pointing it to the server running the Pi-hole container 192.168.0.101
.
Then I set up the Audiobookshelf container using the guide from Audiobookshelf, where I set up Nginx Proxy Manager with the following compose file:
services:
nginx-proxy-manager:
image: docker.io/jc21/nginx-proxy-manager:latest
container_name: nginx-proxy-manager
ports:
- 80:80
- 443:443
- 81:81
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
restart: unless-stopped
And Audiobookshelf with the following compose file:
services:
audiobookshelf:
image: ghcr.io/advplyr/audiobookshelf:latest
container_name: audiobookshelf
volumes:
- ./audiobooks:/audiobooks
- ./podcasts:/podcasts
- ./metadata:/metadata
- ./config:/config
restart: unless-stopped
networks:
nginx:
name: nginx-proxy-manager_default
external: true
I did not specify a port, hoping that Nginx could manage it.
Then I set up Nginx Proxy Manager following the guide from Audiobookshelf by adding a proxy host. Trying to resolve I simply followed the guide and wasn’t sure why the “Forward Hostname / IP” should be the container name audiobookshelf.local.com
toaudiobookshelf
.
I also created a self-signed certificate.
But I cannot access https://audiobookshelf.local.com/
or http://audiobookshelf.local.com/
(it automatically forwards to HTTPS).
I tried adding a local DNS record:
audiobookshelf.local.com
→ 192.168.0.101
in Pi-hole.
Now, when I access audiobookshelf.local.com
, the site shows:
502 Bad Gateway – openresty
I think the problem lies in the Docker network setup. I suspect the Audiobookshelf Docker container is not communicating with Nginx.
Would appreciate any help!
thank you!
I have added
ports: - 13378:80
in audiobookshelf docker compose and changed npm settings
But it still gives me the same 502 Bad Gateway error.
You’re missing the networks section in your audiobookshelf service definition - add
networks: [nginx]
to your audiobookshelf service to actually connect it to the network (just defining the network at the bottom doesn’t automatically attach your service to it, which is why npm can’t reach it and gives you that 502 error), and if you’re an audiobook fan you might wanna check out the soundleaf app for ios which works great with audiobookshelf.thank you! this works!
I’ve just noticed: you’ve set your forward hostname/IP to
audiobookshelf
. That should either be your PC’s IP address (if you’ve set up a static one in your router’s panel) or its hostname. Unless you’ve named your PCaudiobookshelf
it still won’t work.This is about addressing the containers in docker. It has nothing to do with the local network.