Traefik vs Nginx Proxy Manager reddit / selfhosted ---------------------------------------------------------------------- Full_Internal_3542 · 2023-10-21 06:54 Hello people, This week I gave Traefik a try, since I wanted to run CrowdSec with it (currently Nginx Proxy Manager + Fail2Ban). Everything worked fine, I got it up and running and exposed the services I wanted to (website etc). The only I problem I faced and yet couldn’t fix is local DNS. This worked just fine with Nginx Proxy Manager. In Pi-Hole, I‘ve setup a A-Name record like this: home.lan -> 192.168.100.70 And various C-Name records which point back to the A-name record. Then in Nginx Proxy Manager, I could easily create a new proxy host which listens on that domain. However, It seems the configuration in Traefik is a little bit different and I couldn’t get it to work yet. Any help is appreciated! ---------------------------------------------------------------------- thekrautboy · 2023-10-21 07:22 The DNS setup is exactly the same wether you use NPM or Traefik. "Couldnt get it to work" is pointless info, sorry. Also /r/Traefik exists fyi. ---------------------------------------------------------------------- cloudswithflaire · 2023-10-21 07:48 I’d actually be interested in any observations you’d care to share regarding/relating to the transfer speeds between both. ---------------------------------------------------------------------- Full_Internal_3542 · 2023-10-21 09:48 Well, maybe you care to explain then? I can provide you with my config whatsoever. Currently I had these lables on the services I exposed to the public: `traefik.enable=true` `traefik.http.routers.website.entrypoints=websecure` `traefik.http.routers.website.rule=Host(\`web.domain.com\`)` `traefik.http.routers.website.tls=true` `traefik.http.routers.website.tls.certresolver=production` Putting these labels with e.g. `Host(\`pihole.home.lan\`)` doesnt seem to work for me. ---------------------------------------------------------------------- thekrautboy · 2023-10-21 09:54 This is what i use - traefik.enable=true - traefik.docker.network=traefikproxy - traefik.http.routers.CHANGEME.rule=Host(`CHANGEME.local.example.com`) # change name - traefik.http.services.CHANGEME.loadbalancer.server.port=80 # change name AND port #- traefik.http.services.CHANGEME.loadbalancer.server.scheme=https # only for HTTPS target ---------------------------------------------------------------------- violet-crayola · 2023-10-21 10:00 Do you have any real domains at all? You can simply set real sobdomain to your internal IP and not bother with pihole ---------------------------------------------------------------------- Full_Internal_3542 · 2023-10-21 10:02 I do yes. But for local usage, i would like not to use my public domain, but rather `subdomain.home.lan` I could live with [`subdomain.home.domain.com`](https://subdomain.home.domain.com), but I find option 1 more suitable. ---------------------------------------------------------------------- indykoning · 2023-10-21 11:16 Traefik or NPM both do not do anything with DNS, as long as you reach the server with the correct host they will route it for you and not care how you got there. What do you mean "couldn't get it to work"? What was the error you run into? Do you get an "ERR_NAME_NOT_RESOLVED" or a simple Traefik 404 page? Do the Traefik logs show any reason for being unable to pick up the config? ---------------------------------------------------------------------- CC-5576-03 · 2023-10-21 11:53 Nginx and trafik have nothing to do with DNS, they're reverse proxies. You set the default DNS servers on your router/clients to the pihole ip, and in pihole you have A record pointing to the ip address of your reverse proxy. ---------------------------------------------------------------------- chillypowder · 2023-10-21 12:29 Try adding a wildcard DNS entry to PI-hole. Pi-hole front end won’t let you create a wildcard DNS but you can do it through the command line. https://hetzbiz.cloud/2022/03/04/wildcard-dns-in-pihole/?amp=1 ---------------------------------------------------------------------- krankykrio · 2023-10-21 12:51 Thank you for the link. ---------------------------------------------------------------------- thekrautboy · 2023-10-21 16:25 Why are you sending me unsolicited reddit chat messages now? Please stop that. ---------------------------------------------------------------------- Serverless · 2023-10-21 16:39 If you want to use NPM with Crowdsec you can install LePresidente NPM fork that includes the openresty bouncer. It's updated to the latest NPM version. [https://github.com/LePresidente/docker-nginx-proxy- manager](https://github.com/LePresidente/docker-nginx-proxy-manager) If you are using the jlesage docker, you can simply switch the repository and it will work immediately. ---------------------------------------------------------------------- ethereal_g · 2023-10-21 17:59 >Everything worked fine, I got it up and running and exposed the services I wanted to I'm assuming here that you mean you can access your services on the internet at `subdomain.domain.com` successfully, but you're running into issues accessing those services on your LAN at `subdomain.home.lan`. What kind of error or issue are you experiencing? Are you pointing `subdomain.home.lan` on the pihole to traefik? Is traefik configured to serve the `subdomain.home.lan` domain? Why not use split horizon DNS here, and configure records for `subdomain.domain.com` on the pihole pointing to your local/private IP? That provides logical separation of DNS information from the public internet. This is what I do on my homelab (using traefik/crowdsec/pihole even!) and it works great. ---------------------------------------------------------------------- JasonKruys · 2023-10-22 08:14 ^ This. That's what I did, and it works very well.