在 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/