[GH-ISSUE #2292] Proxying Karakeep via container name vs IP address breaks mobile app #1398

Open
opened 2026-03-02 11:57:02 +03:00 by kerem · 4 comments
Owner

Originally created by @titandrive on GitHub (Dec 22, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2292

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

  1. Access Karakeep via Proxy (i.e., caddy)
  2. Add Karakeep (and all associated containers) to same docker network as Proxy
  3. Proxy Karakeep via container name (karakeep:3000) instead of IP
  4. 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
Originally created by @titandrive on GitHub (Dec 22, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2292 ### 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 1. Access Karakeep via Proxy (i.e., caddy) 2. Add Karakeep (and all associated containers) to same docker network as Proxy 3. Proxy Karakeep via container name (karakeep:3000) instead of IP 4. 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? - [x] I have checked the troubleshooting guide and I haven't found a solution to my problem
Author
Owner

@MohamedBassem commented on GitHub (Dec 22, 2025):

I use karakeep behind caddy as well and it works fine. We need more debugging info. For example pressing the debug button in the login screen and sharing the result. Also looking at caddy's logs and see if requests reach it and what they get back from karakeep, etc

<!-- gh-comment-id:3684199873 --> @MohamedBassem commented on GitHub (Dec 22, 2025): I use karakeep behind caddy as well and it works fine. We need more debugging info. For example pressing the debug button in the login screen and sharing the result. Also looking at caddy's logs and see if requests reach it and what they get back from karakeep, etc
Author
Owner

@titandrive commented on GitHub (Dec 22, 2025):

I use karakeep behind caddy as well and it works fine. We need more debugging info. For example pressing the debug button in the login screen and sharing the result. Also looking at caddy's logs and see if requests reach it and what they get back from karakeep, etc

Ok, give me a few. Do you proxy it via IP or container name in caddy? I have no issue using caddy with IP.

<!-- gh-comment-id:3684240191 --> @titandrive commented on GitHub (Dec 22, 2025): > I use karakeep behind caddy as well and it works fine. We need more debugging info. For example pressing the debug button in the login screen and sharing the result. Also looking at caddy's logs and see if requests reach it and what they get back from karakeep, etc Ok, give me a few. Do you proxy it via IP or container name in caddy? I have no issue using caddy with IP.
Author
Owner

@titandrive commented on GitHub (Dec 25, 2025):

Sorry, I had to wait until it stopped working again.

This is what happens when it breaks. Nothing in the app loads:

Image

This is what happens when I try to reconnect after it stops working:

Image

The debug log is not very helpful:

Running connection test ...

Using address: https://karakeep.domain.com/

Looking at Caddy logs is more helpful.

aborting with incomplete response
upstream: karakeep:3000
error: reading: context canceled

uri="/dashboard/bookmarks?_rsc=vusbg"
headers: Rsc=1
Next-Router-State-Tree=...

aborting with incomplete response
error: context canceled

Its very intermittent whether it works. It wouldnt work last night and now it works again this morning when I tried to pull more logs.

<!-- gh-comment-id:3691753428 --> @titandrive commented on GitHub (Dec 25, 2025): Sorry, I had to wait until it stopped working again. This is what happens when it breaks. Nothing in the app loads: <img width="754" height="1660" alt="Image" src="https://github.com/user-attachments/assets/5f5b6aaa-9268-4426-9fb1-44b99ddf5543" /> This is what happens when I try to reconnect after it stops working: <img width="762" height="1660" alt="Image" src="https://github.com/user-attachments/assets/98be6e61-4333-4422-a87b-aff2c6bfc87b" /> The debug log is not very helpful: ``` Running connection test ... Using address: https://karakeep.domain.com/ ``` Looking at Caddy logs is more helpful. ``` aborting with incomplete response upstream: karakeep:3000 error: reading: context canceled uri="/dashboard/bookmarks?_rsc=vusbg" headers: Rsc=1 Next-Router-State-Tree=... aborting with incomplete response error: context canceled ``` Its very intermittent whether it works. It wouldnt work last night and now it works again this morning when I tried to pull more logs.
Author
Owner

@titandrive commented on GitHub (Dec 27, 2025):

Im going to have to do more debugging because strangely now it breaks now if I proxy with the IP. The only way I can get the app to work is by connecting directly via the IP:PORT. Using the proxied url seems to break it.
@MohamedBassem , can you share your working caddy config for Karakeep? This is the only app I have issues with but Im wondering if Im doing something wrong.

<!-- gh-comment-id:3694292158 --> @titandrive commented on GitHub (Dec 27, 2025): Im going to have to do more debugging because strangely now it breaks now if I proxy with the IP. The only way I can get the app to work is by connecting directly via the IP:PORT. Using the proxied url seems to break it. @MohamedBassem , can you share your working caddy config for Karakeep? This is the only app I have issues with but Im wondering if Im doing something wrong.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1398
No description provided.