Terence's blog

  • 问题
  • 原因
  • 解决
  • About Me

解决反代docker seafile提示CSRF错误

  • Terence
  • 2023-11-20
  • 0

问题

服务器需要运行其他网站,不能让docker seafile独占80/443端口,于是使用nginx再做一次反代,并且设置强行转跳https,然后报CSRF错误:

CSRF verification failed. Request aborted.
More information is available with DEBUG=True.

查看接口,返回:

... https://xxx.com is not trusted origins

原因

django的安全验证问题,不熟掠过。。

解决

编辑[volumes]/seafile/conf/seahub_settings.py文件,
修改字段为CSRF_TRUSTED_ORIGINS = ['https://xxx.com'],如果没有就添加一行。
重启容器docker restart seafile。


© 2025 Terence's blog
Theme by Wing
  • {{ item.name }}
  • {{ item.name }}