I have only one single domain and I can’t use subdomains, but I want to put multiple services on that one domain, by putting each of them on its own webpath.
For example, I want a mainpage broadcasting to mainpage:8080/ accessible at domain.tld/, a Nextcloud server broadcasting to nextcloud:8081 accessible at domain.tld/nextcloud etc.
To put it simply, I just want to proxy all of the services I want and have them be accessible in their own custom webpath. I want to access, say, web:8081/* at domain.tld/web/* and have that be transparent to the service that gets proxied.
For now I’ve just been testing to reverse proxy an empty Nginx container to a custom webpath
How can I do this? I tried multiple combinations of rewrites, handle_paths, reverse_proxies etc. to no avail. I don’t want to make the container broadcast to /web too, I just want to reverse proxy to domain.tld/web even if the container doesn’t broadcast to web:8081/web, and is just simply broadcasting to its webroot, web:8081/
2. Error messages and/or full log output:
I'm not getting any errors
3. Caddy version:
Latest from Docker, v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
4. How I installed and ran Caddy:
a. System environment:
Docker version 20.10.24+dfsg1, build 297e128
docker-compose version 1.29.2, build unknown
Debian GNU/Linux 12 (bookworm) aarch64
Linux 6.1.21-v8+ aarch64 GNU/Linux
Raspberry Pi 4 Model B Rev 1.1
Why can’t you use a subdomain? It’s by far the easiest and most reliable solution. Otherwise, you’re at the whims of the apps you want to proxy to. Not all of them support “base path” configuration.
Because, the truth is, I don’t really own my own ‘domain’. I enabled my ISP’s dynamic DNS option, and I do not really want to pay for a domain. Even if I did, I’d have to set up a static IP address for that, which, judging by the fact that it’s just my home network, it doesn’t sound like a good idea
Honestly, now that you give me this solution, I’ll look into it. I’m sick of trying to get webpaths running. I’ve literally been procrastinating making my server functional for almost two years because of it. I’ll keep you updated if I have any more issues with this approach
I’m following this approach currently but I’ve stumbled across something. How do I use the Caddy dynamic dns app/plugin/whatever without putting my DuckDNS token in plaintext in my Caddyfile? I use Docker secrets across my entire config so I’m wondering if there’s any other way to put secrets in the Caddyfile? All I can see is that I can use environment variables to do so