[GH-ISSUE #2457] All authenticated POST endpoints return 403 behind nginx (signout + tRPC mutations) despite valid session & CSRF; docker restart temporarily fixes #1477

Closed
opened 2026-03-02 11:57:35 +03:00 by kerem · 1 comment
Owner

Originally created by @anupamck on GitHub (Feb 5, 2026).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2457

Describe the Bug

I’m running Karakeep behind an nginx reverse proxy. Login works and the dashboard loads, but all authenticated POST requests fail with 403 Forbidden, including:

POST /api/trpc/bookmarks.createBookmark?batch=1

POST /api/auth/signout

The browser console then throws:

Failed to execute 'json' on 'Response': Unexpected end of JSON input

because the 403 response body is empty / non-JSON.

This is not limited to bookmarking — even signing out fails.

Key point: GET endpoints work, session is valid, CSRF endpoint works — but POST actions are rejected.

However, restarting docker-compose temporarily resolves this issue (I am hosting Karakeep via docker with Meilisearch, env file is given below):

KARAKEEP_VERSION=release
NEXTAUTH_SECRET=***
MEILI_MASTER_KEY=***
NEXTAUTH_URL=https://karakeep.anupam.de
DISABLE_SIGNUPS=true

What I've already checked

Browser POSTs include CSRF token

Confirmed in DevTools:

Despite this, server returns: 403 Forbidden

Direct upstream call via curl on the server also returns 403. E.g. curl -i http://localhost:3000/api/trpc/bookmarks.createBookmark?batch=1

Steps to Reproduce

  1. Deploy Karakeep via docker-compose
  2. Put nginx in front (TLS termination)
  3. Log in via browser
  4. Try to:
  • Add bookmark
  • Sign out

Observed:

  • POST endpoints return 403
  • frontend crashes parsing JSON
  • user cannot mutate state or log out

Restarting docker-compose temporarily resolves the issue.

Expected Behaviour

Authenticated users should be able to:

  • Create bookmarks
  • Sign out

If rejected, server should return structured JSON instead of raw 403.

Screenshots or Additional Context

No response

Device Details

No response

Exact Karakeep Version

Karakeep v0.27.1

Environment Details

Docker + Nginx

Debug Logs

No response

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 @anupamck on GitHub (Feb 5, 2026). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2457 ### Describe the Bug I’m running Karakeep behind an nginx reverse proxy. Login works and the dashboard loads, but all authenticated POST requests fail with 403 Forbidden, including: POST /api/trpc/bookmarks.createBookmark?batch=1 POST /api/auth/signout The browser console then throws: `Failed to execute 'json' on 'Response': Unexpected end of JSON input` because the 403 response body is empty / non-JSON. This is not limited to bookmarking — even signing out fails. Key point: GET endpoints work, session is valid, CSRF endpoint works — but POST actions are rejected. However, restarting docker-compose temporarily resolves this issue (I am hosting Karakeep via docker with Meilisearch, env file is given below): ``` KARAKEEP_VERSION=release NEXTAUTH_SECRET=*** MEILI_MASTER_KEY=*** NEXTAUTH_URL=https://karakeep.anupam.de DISABLE_SIGNUPS=true ``` ### What I've already checked Browser POSTs include CSRF token Confirmed in DevTools: - POST /api/auth/signout includes csrfToken - Cookies are attached - Origin and Referer are correct (https://karakeep.anupam.de) Despite this, server returns: 403 Forbidden Direct upstream call via curl on the server also returns 403. E.g. `curl -i http://localhost:3000/api/trpc/bookmarks.createBookmark?batch=1` ### Steps to Reproduce 1. Deploy Karakeep via docker-compose 2. Put nginx in front (TLS termination) 3. Log in via browser 4. Try to: - Add bookmark - Sign out Observed: - POST endpoints return 403 - frontend crashes parsing JSON - user cannot mutate state or log out Restarting docker-compose temporarily resolves the issue. ### Expected Behaviour Authenticated users should be able to: - Create bookmarks - Sign out If rejected, server should return structured JSON instead of raw 403. ### Screenshots or Additional Context _No response_ ### Device Details _No response_ ### Exact Karakeep Version Karakeep v0.27.1 ### Environment Details Docker + Nginx ### Debug Logs _No response_ ### Have you checked the troubleshooting guide? - [x] I have checked the troubleshooting guide and I haven't found a solution to my problem
kerem 2026-03-02 11:57:35 +03:00
Author
Owner

@anupamck commented on GitHub (Feb 9, 2026):

This issue went away on its own after I updated to a higher karakeep version (0.30.0). So I will close this for now, and open it again if it reoccurs.

<!-- gh-comment-id:3870395925 --> @anupamck commented on GitHub (Feb 9, 2026): This issue went away on its own after I updated to a higher karakeep version (0.30.0). So I will close this for now, and open it again if it reoccurs.
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#1477
No description provided.