django.security.csrf: Forbidden (Origin checking failed –
https://sentry-domain.com does not match any trusted origins.)
I installed self-hosted-master sentry from https://github.com/getsentry/self-hosted based on documentation on: https://theappsguy.dev/setting-up-sentry-self-hosted
I configured it for SSL with changing:
nginx/nginc.conf
:
- from
proxy_set_header X-Forwarded-Proto https; (instead $shema);
- to
proxy_set_header X-Forwarded-Proto https; (instead https);
sentry/sentry.conf.py
:
- uncomment:
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
.env
: SENTRY_USE_SSL=1
sentry/config.yml
:
- uncommnet:
system.url-prefix: 'https://<IP>'
and I configure a proxy above this configuration on OS to forward traffic toward server name
I can see GUI of sentry with https://sentry.domain.com
but when it comes to login (correct or wrong username and password)
I see the below error:
and in logfile this error appears:
django.security.csrf: Forbidden (Origin checking failed –
https://sentry-domain.com does not match any trusted origins.):
/account/recover/ (status_code=403 request=<WSGIRequest: POST
‘/account/recover/’>)
2
Answers
It is solved by some steps at first based on documentation I set up environmet before start installing
I removed those configuration
then I change config.yml and changed system.url-prefix: 'https:/IP' to system.url-prefix: 'https:/sentry.domain.com'
stop containers then reload daemon restart docker start containers
What were the steps from the docs nthat you changed as I have exactly the same issue…
CSRF_TRUSTED_ORIGINS = ["internal.sentry.domain.com",
"127.0.0.1:9000"]
and I’m still getting the CsRF Verification Failed lwith the msame error in the logs as you?
Thanks