1. Output of
Docker caddy v2.6.2
2. How I run Caddy:
I am running caddy using Docker Desktop and docker compose
a. System environment:
uhhhh the docker desktop start arrow?
c. Service/unit/compose file:
- /Users/zach/CaddyDocker/data:/data # Optional
- /Users/zach/CaddyDocker/config:/config # Optional
d. My complete Caddy config:
# Global options block. Entirely optional, https is on by default
# Optional email key for lets encrypt
# Optional staging lets encrypt for testing. Comment out for production.
3. The problem I’m having:
The issue I am having is that it seems that the reverse proxy does not do anything.
When I goto mysite.xyz:1234 I am properly directed to my jellyfin server, but that is because I had that set up in the port forwarding options of my router beforehand.
Similarly, if i go to jellyfin.mysite.xyz:1234 I am brought to jellyfin, however if I only go to jellyfin.mysite.xyz I get a “ERR_EMPTY_RESPONSE” from my web browser.
4. Error messages and/or full log output:
Paste logs/commands/output here.
USE THE PREVIEW PANE TO MAKE SURE IT LOOKS NICELY FORMATTED.
Honestly this is my first foray into webhosting and sysadmin, I do not even know where I would find additional information. I am happy to look up whatever I need to, but at the moment I dont know what I dont know!
5. What I already tried:
I have tried a few different solutions like below
reverse_proxy * 0.0.0.0:8096
reverse_proxy * 0.0.0.0:30000
reverse_proxy * localhost:8096
reverse_proxy * localhost:30000
but they all seem to have the same problems.
6. Links to relevant resources:
0.0.0.0 doesn’t really make sense – that IP address isn’t a real address, it just means “all addresses”. Many HTTP clients end up dialing effectively “localhost” with that though. Using
0.0.0.0 is more useful as a listen address, because it means to listen to all interfaces.
When in Docker,
localhost means “this same container”. So trying to
reverse_proxy to localhost won’t reach anything, because nothing else is running inside Caddy’s container.
Instead, you need to connect to the other container that’s running your service. Docker has a built-in DNS resolver that lets you connect to other containers by their name. You didn’t show what your other services are in your docker-compose.yml so I can’t tell you what to use, but it should be pretty obvious, just use that service’s name.
hi thanks man!
I am trying to grab the foundry server and the jellyfin servers show in the attached screenshot,
can you tell me from here what names I should be using? I am sorry for the basic questions, this is kind of my first foray into docker and networking in general.
should I be using a line more like:
Yeah almost, but you need to specify the correct port to use. From that screenshot, it seems like that should be
Also, you need to have a space after your site address and before the
well… still no luck.
my caddyfile has been updated to:
but unfortunately still no luck. Is there maybe something I should be doing to the docker-compose file?
thank you again for your help on this!
For docker’s internal DNS to work, Caddy and your other containers need to share a docker network.
You are already using
so make sure to add either of those networks to
Please also refer from using screenshots to share your Caddyfile, as per the forum rules.
Post it as text in the future. Thank you
Oops sorry for that!
I have added the web network to the jellyfin compose, but I am still not seeing anything.
I am not sure what I am missing here, thank you for all of your assistance!
You need to elaborate why you mean by
If you see a blank page in your browser, open the network tab in your browsers’ developer console.
You might see a status code != 200
Also, the name in your Caddyfile needs to match the
jellyfin) in your docker-compose.
Or if no
container_name is set, it needs to match the service name (in your case also
So assuming you didn’t change your Caddyfile since your last Screenshot, you need to either rename
jellyfinstuff or change
reverse_proxy jellyfinstuff:8096 to
You are absolutely correct, I should be more clear.
when i attempt to access jellyfin.mysite.xyz i get a “ERR_EMPTY_RESPONSE” as the error, even after making the change you have mentioned.
However, docker decided to cooperate and let me see the real time logs today, and i noticed a “firewall is probably the problem message” which lead me to realize… I never set up to 80 and 443 port forwarding on my router… genius right here.
Thank you all for your help with this!