Proxying Karakeep via container name vs IP address breaks mobile app
Describe the Bug
I try to avoid unnecessary port exposure in my containers when possible. As such, I remove exposed ports for each container and proxy it (via Caddy) using the container name instead. For example:
karakeep.domain.com {
reverse_proxy karakeep:3000
}This normally works without issue on most containers but I am running into problems with Karakeep. When I do this, I have no issue accessing the webui (http://karakeep.domain.com). But I am finding that it breaks the mobile app.
As soon as I switched from proxying via the IP address to the container name, the mobile app stopped logging in. When I try to log in, it will give an error (invalid API key or invalid username and password).
I tried experimenting with inserting headers:
karakeep.domain.com {
reverse_proxy karakeep:3000 {
header_up Host {host}
header_up X-Forwarded-Host {host}
header_up X-Forwarded-Proto https
header_up X-Forwarded-For {remote}
}
}After I did this, I found that it would work for a few hours before the app would be unable to load any further and I would get the same errors again.
Moving back to proxying via IP solved the issue.
Steps to Reproduce
- Access Karakeep via Proxy (i.e., caddy)
- Add Karakeep (and all associated containers) to same docker network as Proxy
- Proxy Karakeep via container name (karakeep:3000) instead of IP
- Attempt to login to mobile app
Expected Behaviour
I expect the mobile app to be able to login without issue.
Screenshots or Additional Context
No response
Device Details
No response
Exact Karakeep Version
Server Version 0.29.3 / Android App 1.8.3
Have you checked the troubleshooting guide?
- I have checked the troubleshooting guide and I haven't found a solution to my problem
Source: karakeep-app/karakeep