Use Caddy as the reverse proxy
Hi,
I've been trying to use my Caddy reverse proxy with Homarr, but I'm encountering a problem. Homarr starts using http://ca7dab43dd9f:7575 (Docker container ID) instead of 127.0.0.1 (localhost).
This is my docker-compose.yml file:
I have the same exact setup using Homepage (https://github.com/gethomepage/homepage) as my personal dashboard for my homelab, and it's working fine. However, I would prefer to use Homarr because I find it nicer. 🙂
I have seen that Traefik works with Homarr. Will Caddy be supported someday? Do you know what might be wrong with my current setup?
Thanks for the support!
GitHub
GitHub - gethomepage/homepage: A highly customizable homepage (or s...
A highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations. - gethomepage/homepage
Solution:Jump to solution
I don't know what to write, and I'm not the best English writter 🙂
I have also done this on localhost, I think to use any domain it only require to change it in the Caddyfile
homarr.mydomain.com
for example. But I can't test this right now because I don't have any domain....16 Replies
Thank you for submitting a support request.
Depending on the volume of requests, our team should get in contact with you shortly.
⚠️ Please include the following details in your post or we may reject your request without further comment: - Log (See https://homarr.dev/docs/community/faq#how-do-i-open-the-console--log) - Operating system (Unraid, TrueNAS, Ubuntu, ...) - Exact Homarr version (eg. 0.15.0, not latest) - Configuration (eg. docker-compose, screenshot or similar. Use ``your-text`` to format) - Other relevant information (eg. your devices, your browser, ...)
❓ Frequently Asked Questions | Homarr documentation
Can I install Homarr on a Raspberry Pi?
Hi, the URL you see in the logs is just internal. It will & should not be used outside of the container.
Apps don't implement "support for reverse proxies" - they should already work out of the box and your Caddy is likely misconfigured or doesn't forward the requests to Homarr.
Have you looked into the proxy log? Any log entries in Homarr? Can you reach Homarr from Caddy?
First of all thanks for the explanation! And yes I have the logs, the message was too long so I didn't add it 🙂
"remote_ip":"172.20.0.1","remote_port":"45718"
are you sure that you forward the requests to the correct port?
By default, we expose to 7575 and you seem to do the same.I have all the other containers with this setup and the only one is not working is this, this is because I thought was problem of how Homarr is starting. I have been looking at the Github repo too.
Caddyfile:
...
homarr.localhost {
reverse_proxy homarr:7575
}
...
I don't know what's wrong, I posted this here to see if somebody has the same error.
OMG, i don't know why but after restarting both containers it's working now... Thanks for your help, if you want I can share the whole setup to help people in the future. You can add it to the https://homarr.dev/docs/advanced/configuration/proxies-and-certificates
🔀 Proxies and Certificates | Homarr documentation
Allowing self-signed certificates
Yes, please do share it (contribute it to https://github.com/homarr-labs/documentation ). I'll mark this as resolved
GitHub
GitHub - homarr-labs/documentation
Contribute to homarr-labs/documentation development by creating an account on GitHub.
Solution
I don't know what to write, and I'm not the best English writter 🙂
I have also done this on localhost, I think to use any domain it only require to change it in the Caddyfile
homarr.mydomain.com
for example. But I can't test this right now because I don't have any domain.For other people: You only have to put Caddyfile at the same folder as compose.yaml (or docker-compose.yml, both names are accepted). And run
docker compose up -d
and you are done 🙂
@Manicraft1001 If somebody can contribute this and do a better explanation to the documentation repository would be very nice.Almost nobody in this server is native English speaker. We mostly are from Europe.
I'd suggest you to try it anyway - all additions are reviewed by us before they go live.
It's likely that simply nobody will pick it up otherwise.
Okay, I will try it tomorrow! I've never contributed in any repository. Do I need to clone the documentation repo, make a new branch. Do changes, do pnpm start and check if it's OK and then commit and push. Am I wrong? Tell me and I will do my best.
You need to fork (since you don't have permissions to push directly).
You can close locally or make small adjustments directly via GitHub.
It is recommended to quickly install dependencies using
pnpm i
and start the app with pnpm start
. Then you can navigate to the page to check our your changes.
After you're done, submit a PR and we'll give you feedback 🙂Oh true, I forgot the fork 🙂 thanks! I'll be doing this as soon as I can. Good night!
I have done the Pull Request adding the Caddy setup to the documentation repository. I hope I've done it well 🙂 Tell me if you need anything more!
Thank you, we will review soon