django.security.csrf: Forbidden (Origin checking failed - https://sentry.domain.com does not match any trusted origins.)

152 Views Asked by At

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/'>)

1

There are 1 best solutions below

0
manikh On

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