c++ - 如何修复 Sentry 中缺少的 CSRF token

标签 c++ c django sentry

在 openshift 上安装它时与哨兵战斗后,我启动并运行它只是发现当向我的服务器发送事件时它会抛出这个错误:

12:30:59 [WARNING] django.request: Forbidden (CSRF cookie not set.): /api/1/envelope/ (status_code=403 request=<WSGIRequest: POST u'/api/1/envelope/'>) 10.125.2.1 - - [20/Jul/2020:12:30:59 +0000] "POST /api/1/envelope/ HTTP/1.1" 403 6059 "-" "sentry.native/0.3.4"


如果我向 API 发送 curl 请求,我会得到一个显示 csrf 错误的简洁 HTML 网页。有人知道这里可能有什么问题吗?

最佳答案

代理/api/给哨兵接力 worker 。相关部分来自 https://github.com/getsentry/onpremise/blob/master/nginx/nginx.conf

upstream relay { server relay:3000; }
upstream sentry { server web:9000; }
server {
    location /api/store/ { proxy_pass http://relay; }
    location ~ ^/api/[1-9]\d*/ { proxy_pass http://relay; }
    location / { proxy_pass http://sentry; }
}

关于c++ - 如何修复 Sentry 中缺少的 CSRF token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62995720/

相关文章:

c - 奇怪的行为 printf - c lang

c - 如何将指针数组归零

c - 根据宏定义,这个输出是什么

python - Django 项目中数据库路由的 routers.py 放在哪里

django - pip 找不到 pypi 项目的最新版本

Django 动态设置基础设施和最佳实践

c++ - 函数返回类型中的 "&"符号是什么意思?

c++ - CMake 链接失败

C++ 结构内存分配

c++ - 从输入中添加连续整数(从 Python 翻译成 C++)