-
What's your question or issue?Not a new open question — following up on my own old, unresolved thread Root cause: the reverse proxy (Apache in my case, but the mechanism is proxy-agnostic) What have you tried?
Paperless-ngx version2.20.3 Host OSDietPi (Debian 13 "trixie"), aarch64 Installation methodDocker - official image System status{
"pngx_version": "2.20.3",
"server_os": "Linux-6.18.37-current-rockchip64-aarch64-with-glibc2.41",
"install_type": "docker",
"storage": {
"total": 3936686497792,
"available": 22958227456
},
"database": {
"type": "postgresql",
"url": "paperless",
"status": "OK",
"error": null,
"migration_status": {
"latest_migration": "paperless_mail.0001_initial_squashed_0009_mailrule_assign_tags",
"unapplied_migrations": []
}
},
"tasks": {
"redis_url": "redis://broker:6379",
"redis_status": "OK",
"redis_error": null,
"celery_status": "OK",
"celery_url": "celery@f12908ddc8d4",
"celery_error": null,
"index_status": "OK",
"index_last_modified": "2026-07-19T00:00:08.225255+02:00",
"index_error": null,
"classifier_status": "OK",
"classifier_last_trained": "2026-07-19T06:05:01.676028Z",
"classifier_error": null,
"sanity_check_status": "OK",
"sanity_check_last_run": "2026-07-18T22:30:01.708096Z",
"sanity_check_error": null
},
"websocket_connected": "ERROR"
}Relevant logs or output[WARNING] [django.security.csrf] Forbidden (Origin checking failed - null does not match any trusted origins.): /accounts/login/ |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
TL;DR fix: Header edit Referrer-Policy "no-referrer" "same-origin"
Header always edit Referrer-Policy "no-referrer" "same-origin"(Nginx equivalent: This works because Full explanation above, and on the reverse proxy wiki page |
Beta Was this translation helpful? Give feedback.
-
|
This discussion has been automatically closed because it was marked as answered. Please see our contributing guidelines for more details. |
Beta Was this translation helpful? Give feedback.
-
|
Update: since my last reply, I set up a local test harness (real Paperless-ngx behind Apache/Nginx/Caddy, each simulating a DietPi-style global
I've updated the Using a Reverse Proxy wiki page directly: the fix is now baked into the Apache/Nginx/Caddy example configs themselves (a Nextcloud-style split — Also filed against DietPi upstream, since the global default is what triggers this in the first place: MichaIng/DietPi#8223. |
Beta Was this translation helpful? Give feedback.
TL;DR fix:
(Nginx equivalent:
proxy_hide_header Referrer-Policy;followed by your ownadd_header Referrer-Policy "same-origin" always;)This works because
Header set/add_headeralone won't override aReferrer-Policy: no-referreralready being sent from elsewhere in your proxy config (a baseimage default, a distro hardening template — on DietPi it's a global setting in
dietpi.confaffecting every vhost, see MichaIng/DietPi#3675).That
no-referrervalue is what makes browsers sendOrigin: nullon the login POST, whichDjango's CSRF check then rejects — regardless of how co…