this post was submitted on 22 Jul 2025
38 points (95.2% liked)

Selfhosted

49703 readers
235 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

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 audiobookshelf.local.com to~~ I simply followed the guide and wasn’t sure why the “Forward Hostname / IP” should be the container name audiobookshelf.

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.com192.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!

you are viewing a single comment's thread
view the rest of the comments
[–] ShortN0te@lemmy.ml 1 points 1 day ago (1 children)

Based on you screenshot from the NPM Dashboard there seems to be something wrong. In the setup window you show that you forward the traffic with http and port 80, in the dashboard screenshot you forward the traffic with https and port 80.

Just skip http and self signed certificates all together. Modern Browsers make it a pain to use non https sites. A simple domain setup with dns acme challenge is a little bit of a hassle but worth the hour(s) of invested time. Especially with npm were it is a set and forget option.

Does pihole support wildcard dns entries yet? To my knowledge the gui only supports single entries so that you have to enter every subdomain manually in pihole that you want to have forwarded. Workaround would be to use a dnsmasq config file or use something else like addguard.

[–] happeningtofry99158@lemmy.world 1 points 6 hours ago (1 children)

no I don't think pi-hole supports wild card dns, how do you deal with this issue? do you simply use addguard?

[–] ShortN0te@lemmy.ml 1 points 3 hours ago (1 children)

I switched to adguard, yes. But you can just give pi-hole a dnsmasq config file. The underlying dns server Pi-Hole uses does support those.

Just mount the file via a docker volume. I will have to look up the exact paths. Config would look like

address=/domain.tld/192.168.0.1