// troubleshooting guide · seafile
Seafile 403 CSRF Verification Failed
- Status
- Workaround available
- platforms:
- Web (self-hosted server)
- updated:
- November 16, 2026
- reports:
- 6
- Method
- how we research
RUNBOOK · seafile/csrf-verification-failed4 FIXES
// quick answer
Seafile 11+ uses a newer Django that checks the Origin header strictly. Set CSRF_TRUSTED_ORIGINS to your exact URL with https://, fix any doubled 'http://https://', and make your reverse proxy pass Host and X-Forwarded-Proto.
Most likely fix: Set CSRF_TRUSTED_ORIGINS correctly
How to fix it
// try these in order, the most common fix is first
FIX 1Set CSRF_TRUSTED_ORIGINS correctly
- 01Open seahub_settings.py (Docker: seafile_data/seafile/conf/seahub_settings.py)
- 02Add or edit: CSRF_TRUSTED_ORIGINS = ['https://files.example.com'] using your exact public URL with scheme
- 03Restart the Seafile container or seahub
Did this fix it?FIX 2Remove the doubled protocol
- 01Search seahub_settings.py for 'http://https://'
- 02Replace it with 'https://'
- 03Restart Seafile
Did this fix it?FIX 3Forward the right headers from your proxy
- 01Nginx: in the Seahub location add proxy_set_header Host $http_host; and proxy_set_header X-Forwarded-Proto $scheme;
- 02HAProxy: add http-request set-header X-Forwarded-Proto https on the HTTPS frontend
- 03Reload the proxy and clear browser cookies for the site
Did this fix it?FIX 4Find the exact rejection reason
- 01Temporarily set DEBUG = True in seahub_settings.py and restart
- 02Reproduce the login; the error page shows which origin or referer was rejected
- 03Check seahub.log for the same message, then set DEBUG back to False
Did this fix it?
SANDBOX · seafile RUNS IN YOUR BROWSER
Try it: upload, share and sync files between the web and your laptop
A hands-on Seafile-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.
Symptoms
Logging in or submitting a form shows 'Forbidden (403) CSRF verification failed. Request aborted.', often right after an upgrade or after putting Seafile behind a new proxy.
Why it happens
- C-01Newer Django (Seafile 11+) enforces Origin/Referer checks against trusted origins
- C-02CSRF_TRUSTED_ORIGINS missing the scheme (https://)
- C-03Docker setup writing a doubled 'http://https://' into seahub_settings.py
- C-04Reverse proxy not forwarding the Host or X-Forwarded-Proto header
- C-05Seafile served under a subpath such as /seafile
// this guide also covers
- seafile csrf verification failed
- seafile 403 forbidden
- seafile csrf_trusted_origins
- seafile docker csrf error
Still not working?
If Seafile keeps failing, you're not alone. See every Seafile problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other Seafile errors
- Seafile 502 Bad Gateway After Upgrade
- Seafile Client Not Syncing
- Seafile 'Error When Indexing' / Failed to Index File
- Seafile Upload Failed for Large Files (413 Error)
- Seafile Not Freeing Disk Space
- Seafile OnlyOffice 'Download Failed' Error
- Seafile Pro Shows Community Edition After Upgrade
- Seafile Encrypted Library Forgot Password