skip to Main Content

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


  1. Chosen as BEST ANSWER

    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


  2. What were the steps from the docs nthat you changed as I have exactly the same issue…

    • I tried flushing the volumes of docker
    • resetting the whole db and volumes
    • changing the system.url-prefix to https://internal.sentry.domain.com
    • tried it without https, but with http
    • changed the sentry.config.py, the last line to be:
      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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search