django.security.csrf:禁止(来源检查失败 - https://sentry.domain.com 与任何可信来源不匹配。)

问题描述 投票:0回答:1

django.security.csrf:禁止(来源检查失败 - https://sentry-domain.com 与任何可信来源不匹配。) 我根据以下文档从 https://github.com/getsentry/self-hosted 安装了自托管主哨兵: https://theappsguy.dev/setting-up-sentry-self-hosted

我将其配置为 ssl,并进行了更改:

  • nginx/nginc.conf: proxy_set_header X-Forwarded-Proto https; (而不是$shema); 到 proxy_set_header X-Forwarded-Proto https; (而不是 https);

  • sentry/sentry.conf.py: 取消注释: SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

  • .env: SENTRY_USE_SSL=1 和

  • 哨兵/config.yml: 取消通讯: system.url-前缀:'https://'

  • 我在操作系统上的此配置之上配置了一个代理,以将流量转发到服务器名称

我可以通过 https://sentry.domain.com 看到哨兵的 GUI 但是当涉及到登录时(正确或错误的用户名和密码) 我看到以下错误: 并且在日志文件中出现此错误: django.security.csrf:禁止(来源检查失败 - https://sentry-domain.com 与任何可信来源不匹配。):/account/recover/ (status_code=403 request=)

sentry django-csrf apache-sentry
1个回答
0
投票

通过一些步骤可以解决 首先根据文档,我在开始安装之前设置了环境

我删除了那些配置

然后我更改 config.yml 并将 system.url-prefix: 'https:/IP' 更改为 system.url-prefix: 'https:/sentry.domain.com'

停止容器 然后重新加载守护进程 重新启动码头工人 启动容器

© www.soinside.com 2019 - 2024. All rights reserved.